Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

196? 246?

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.

share|improve this question

closed as too localized by qbi, Eric Carvalho, Seth, Uri Herrera, vasa1 Feb 25 '13 at 3:37

This question is unlikely to help any future visitors; it is only relevant to a small geographic area, a specific moment in time, or an extraordinarily narrow situation that is not generally applicable to the worldwide audience of the internet. For help making this question more broadly applicable, visit the help center.If this question can be reworded to fit the rules in the help center, please edit the question.

Welcome to Ask Ubuntu. Thanks for posting your question. However, it's best to ask one question per post. You can add links between your posts if you believe they would be helpful. – Scott Severance Jun 14 '12 at 12:13
Thank you Scott – Thorsen Jun 16 '12 at 6:59
This question appears to be abandoned, if you are experiencing a similar issue please ask a new question with details pertaining to your problem. If you feel this question is not abandoned, please flag the question explaining that. :) – Seth Feb 25 '13 at 1:28

Browse other questions tagged or ask your own question.