I've got a single massive monitor at home, and I've decided to mimic the Windows 7 window tiling shortcuts. I found a few guides online using wmctrl, and it's going well, save one thing: maximized windows don't respond to it.

--type string 
--set /apps/metacity/keybinding_commands/command_1 
   -r :ACTIVE: 
   -e 0,
      `xwininfo -root | grep Width | awk '{ print ($2/2)}'`,
      `xwininfo -root | grep Height | awk '{ print $2 }'`"

(I've added line returns to make an otherwise massive one-liner readable.) I've bound this to a hotkey and it works, unless the window is maximized. Any ideas on how to fix this up?


It works, if you first unmaximize it:

wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz && wmctrl -r :ACTIVE: -e 0,0,0,$(xwininfo -root | grep Width | awk '{print ($2/2)}'),$(xwininfo -root | grep Height | awk '{print $2}')
| improve this answer | |
  • Thanks! I'll try this tonight when I get home and mark resolved when it works. – jldugger Feb 2 '11 at 16:36
  • So I tried that and it doesn't work. I'm using metacity as a window manager, could that be the problem? – jldugger Feb 3 '11 at 2:38
  • It's possible that you need the keybinding to be just one command, so try using bash with the -c option: /bin/bash -c "COMMAND" – htorque Feb 3 '11 at 8:57
  • Yeah, just tested it - it doesn't work as keybinding if you use the double ampersand, but works if you feed it as command string to bash. – htorque Feb 3 '11 at 8:59
  • Thanks, that seems to have been the problem. Sorry I didn't get back on this sooner, I didn't notice the comments. – jldugger May 9 '11 at 1:09

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.