I'm trying to use
wmctrl to write a script that would present to me a list of all currently open windows and then switch to the one I select. It looks something like this:
Now, I'm using the window id I get from
wmctrl -l (for instance, the "0x00c0005c" visible in the screenshot on the 2nd line) to determine exactly which window has been selected (I'm not using the window class because 2 windows belonging to the same application will have the same class, but different ids).
The only problem is:
wmctrl -i -a works sometimes, but doesn't work other times - and some times, it switches, but to the wrong window! It's quite random. After searching online, the only web page I found that even mentions the issue is this one. It says:
WIN as a numerical window ID doesn't seem to work consistently. Perhaps not all options support it or something crazy is going on. It used to work very well for me. Re-test.
Can anyone tell me how I can resolve or work around this issue?
I'm using version 1.07-3 of
wmctrl from the official repositories on an up-to-date Arch Linux machine, and Awesome Window Manager, if it helps. Thanks