I'd like to know (programmatically) which window has current focus. Is there a window-manager independent way of discovering that?
Otherwise, how does one determine which window has focus in Compiz or Metacity?
|
I'd like to know (programmatically) which window has current focus. Is there a window-manager independent way of discovering that? Otherwise, how does one determine which window has focus in Compiz or Metacity? |
||||
|
|
|
What you want is libwnck (if you're just interested in windows) or libbamf (if you're interested in windows and the applications that own them). |
|||||
|
|
If you're happy doing a little X11 programming, then the EWMH spec is what you're after - specifically _NET_ACTIVE_WINDOW. |
|||
|
|
|
Well if you can ping something back to the shell:
Should work. Edit: For slightly cleaner output, try this:
|
||||
|
|
|
Another thing you can use is xdotool:
would return the Window ID of the focussed window, and:
would tell you its name. |
|||||||||||
|
|
From info xtool:
This is what I use for getting the title. (I an on 10.04)
|
|||
|
|