The following script fails to resize an already maximized window:

wmctrl -i -r :ACTIVE: -b remove,maximized_vert,maximized_horz
xdotool windowunmap --sync
xdotool windowmap   --sync
wmctrl -r :ACTIVE: -e 0,300,168,740,470

I am pretty sure the culprit is in the middle two lines, which I am meaning to apply to the currently active window.

1 Answer 1


Looks like the -i option in the first wmctrl cmd is causing trouble.
Try this:

wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz
wmctrl -r :ACTIVE: -e 0,300,168,740,470
  • 1
    It seems as if, when a window is maximized, that wmctrl cannot resize same until such time as the wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz is invoked.
    – Digger
    Jun 16, 2018 at 16:19

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.