Define a custom shortcut for Compiz Window Manager

Ralf Mardorf silver.bullet at
Fri Apr 22 14:55:45 UTC 2016

On Fri, 22 Apr 2016 23:36:15 +1000, Karl Auer wrote:
>   #!/bin/bash
>   WIN=$(xdotool getactivewindow)
>   eval $(xdotool getwindowgeometry --shell $WIN)
>   WIDTH=$(calc "int($WIDTH*0.75)")
>   wmctrl -i -r $WIN -e "0,-1,-1,$WIDTH,-1"

Karl, your script is better, but I need to add
wmctrl -i -r $WINDOW -b remove,maximized_vert,maximized_horz
for windows that are maximised.
In addition I rewrote your script a little bit.

$ cat /usr/local/bin/win75 
eval $(xdotool getwindowgeometry --shell $(xdotool getactivewindow))
WIDTH=$(calc "int($WIDTH*0.75)")
case $1 in
  "") HEIGHT=$(calc "int($HEIGHT*0.75)");
wmctrl -i -r $WINDOW -b remove,maximized_vert,maximized_horz
wmctrl -i -r $WINDOW -e "0,-1,-1,$WIDTH,$HEIGHT"

To resize width and height run
$ win75
to resize the width only run
$ win75 -


More information about the ubuntu-users mailing list