I have some keyboard shortcuts that tile windows around the screen. Under the surface, they just execute various xdotool commands.
For example, here is one that moves the current window to the left half of the screen:
xdotool getactivewindow windowsize 50% 100% && xdotool getwindowfocus windowmove 0 0
This works great most of the time, but I noticed that it doesn’t work when a particular window is "full sized". Clarification: By "full sized", I mean the window state when you double click the window heading and it expands to full size, not necessarily full screen.
For the shortcut to work I have to resize the window to some small size or double click the window title bar to reduce the size again, and then it works great again. It seems GNOME "pins" a full sized screen that makes it immune to xdotool commands.
Is there any way around this? Is there another xdotool command that will implement this?
Thanks!
>Solution :
In your script, you will need to make sure that the window is not maximized. Remove the maximized_vert and maximized_horz using wmctrl first before manipulating it further with xdotool.
wmctrl -r :ACTIVE: -b remove,maximized_vert,maximized_horz && \
xdotool getactivewindow windowsize 50% 100% && \
xdotool getwindowfocus windowmove 0 0
The above works with X.Org. I want to inform other readers that these tools only work in a very limited way on Wayland.