Define a custom shortcut for Compiz Window Manager

Karl Auer kauer at
Sat Apr 23 01:36:47 UTC 2016

On Fri, 2016-04-22 at 20:32 +0200, Ralf Mardorf wrote:
> On Fri, 22 Apr 2016 20:24:25 +0200, Ralf Mardorf wrote:
> > What does manipulate the X and Y values in the below script?
> > The script should keep those values, since nothing does change
> > them.

Interesting. On my system (vanilla 15.10 Unity Compiz) feeding the same
values back into wmctrl moves the windows down 28 pixels. That just
happens to be the exact same height as the title bars on my windows.

eval $(xdotool getwindowgeometry --shell $(xdotool getactivewindow))
NY=$(calc $Y-28)
wmctrl -i -r $WINDOW -e "0,$X,$NY,$WIDTH,$HEIGHT"
sleep 1
eval $(xdotool getwindowgeometry --shell $WINDOW)

The above script does not move the window down. If I comment out the
line with calc in it, the window moves down 28 pixels.

Adding a line to unmaximise the window makes no difference.

If I remove the sleep, then *sometimes* the values returned are the
same, even though the window has moved! I think that might be because
the move happens asynchronously - wmctrl sends a message to the window
manager and returns without waiting, so the second execution of xdotool
completes before the window has actually moved. Just a theory though.

Regards, K.

Karl Auer (kauer at

GPG fingerprint: E00D 64ED 9C6A 8605 21E0 0ED0 EE64 2BEE CBCB C38B
Old fingerprint: 3C41 82BE A9E7 99A1 B931 5AE7 7638 0147 2C3C 2AC4

More information about the ubuntu-users mailing list