Define a custom shortcut for Compiz Window Manager

Ralf Mardorf silver.bullet at
Fri Apr 22 06:55:19 UTC 2016

Hi Karl,

On Fri, 22 Apr 2016 12:57:09 +1000, Karl Auer wrote:
>wmctrl -i -r <ID> -e -1,-1,-1,w,h
                      ^^ this must be 0.

In my experiences wmctrl is useful, if apps get started by a scrip, so
you could change window titles with wmctrl after an app was started,
before the next gets started or directly start with individual window
titles. Using wmctrl with apps started by e.g. a launcher is tricky.
I'll explain a few issues, why I guess it's not the appropriate tool
for the OP's needs. Tested with openbox, so if the OP has got good
luck, the issues don't apply to compiz.

$ wmctrl -l
0x00600003 -1 archlinux panel
0x00c0001d -1 archlinux panel
0x01000003  0 archlinux Rocketmouse - Claws Mail 3.13.2
0x01400012  0 archlinux Inbox (49307 unread) - Evolution
0x01a00003  0 archlinux Unknown Crewman - Sylpheed 3.5.0
0x01c00007  0 archlinux rocketmouse at archlinux:~
0x010e30ed  0 archlinux Re: Define a custom shortcut for Compiz Window Manager - Compose message [Edited]
0x01c0173f  0 archlinux rocketmouse at archlinux:~
0x01c01f99  0 archlinux rocketmouse at archlinux:/home/rocketmouse
$ w=200
$ h=200
$ window="Claws Mail 3.13.2"
$ wmctrl -i -r $(wmctrl -l | grep "$window" | cut -d" " -f1) -e 0,-1,-1,$w,$h

The good news, this works. The bad news, it works only if the Windows
isn't maximised. How can a window be "un"maximised?

Actually 3 windows of roxterm are opened, one of them with 2 tabs, the
others with just 1 tab.

$ ps auxH | grep roxterm
rocketm+  1506  0.0  0.0  13164  2108 pts/2    S+   08:18   0:00 grep roxterm
rocketm+ 16110  0.1  1.0 507028 39660 ?        Sl   00:56   0:31 roxterm --maximize --tab
rocketm+ 16110  0.0  1.0 507028 39660 ?        Sl   00:56   0:00 roxterm --maximize --tab

wmctr -l can recognised them by "rocketmouse at archlinux:"

How can I find out which window is focused?

$ xdotool getwindowgeometry
There are no windows in the stack
Invalid window '%1'
Usage: getwindowgeometry [window=%1]
If no window is given, %1 is used. See WINDOW STACK in xdotool(1)
$ man xdotool
       Certain commands (search, getactivewindow, getwindowfocus) will find windows for you. These results
       generally printed to stdout, but they are also saved to memory for future use during the lifetime of
       the xdotool process. See "COMMAND CHAINING" for more information.

       The only modifications support for the window stack are to replace it. That is, two of two sequential
       searches, only the last one's results will be the window stack.



More information about the ubuntu-users mailing list