I'm trying to write a bash script to control the arrangement of open windows on a particular viewport and have run up against a problem which is basically I can't find a way to reposition the windows in the right order -- the "right order" being the one we might get by alt-tab.
So typically I run my script and the windows are in the right places on screen, but the terminal from which it ran ends up underneath some other window, this being because the list of windows returned by wmctrl doesn't seem to be in alt-tab order.
Perhaps wmctrl doesn't have that information, in which case I'm hoping someone can suggest an alternative interface or approach.
And while I have your attention maybe someone can also explain an oddity I've discovered which is that the window origins returned by "wmctrl -lG" seem to be in 1/2 pixel units +/- an x and y offset or "something" (while the width+height are in pixels)?
So for example:
$ wmctrl -i -r 0x08e01de3 -e 0,100,100,-1,-1
moves the specified window to what looks like 100,100 on screen but then reading the window information back:
$ wmctrl -lG|grep 0x08e01de3 0x08e01de3 0 196 246 1267 639 U10
It's consistent and so easy enough to code around but seems odd to me and has me worried that I'm misunderstanding something.
Thanks for any help and apologies if I've broken any rules with this posting. It's my first "ask" and I'll try to improve for next time.