Score:1

xdotool `windowsize` and `windowmove` don't work in GNOME when the window is full sized

tr flag

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!

waltinator avatar
it flag
Are you using Ubuntu? Which supported release? Read https://askubuntu.com/help/how-to-ask
Score:2
cn flag

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.

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.