Define a custom shortcut for Compiz Window Manager

Karl Auer kauer at
Fri Apr 22 02:57:09 UTC 2016

On Fri, 2016-04-22 at 09:53 +1000, Karl Auer wrote:
> On Fri, 2016-04-22 at 03:15 +0530, Shashwat Kumar wrote:
> > I use compiz windows manage with Ubuntu 14.04. I want to define a 
> > custom shortcut which acts on current focused window.

Add to my previous response a nifty tool called xdotool. It can get you
the geometry of the currently active window:

   xdotool getwindowgeometry

Then you can do the maths on the geometry to get your desired new width
and height w and h, then adjust the window size using wmctrl:

   wmctrl -i -r <ID> -e -1,-1,-1,w,h

Put those things together ina script, register your script in the
"Commands" tab of the Compiz "Commands" module, then bind it to a key
in the "Key Bindings" tab of that module.

The end result should be that if you press that key combo, the current
window gets resized.

But I have not personally tried all this.

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