Resizing a maximized window from the command line

window-managementwmctrlxdotool

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.

Best Answer

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
Related Question