LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   shellscript to check if window has focus, possible? (https://www.linuxquestions.org/questions/programming-9/shellscript-to-check-if-window-has-focus-possible-767552/)

robuust 11-07-2009 12:55 PM

shellscript to check if window has focus, possible?
 
I'm playing a game through wine (fullscreen), when I alt-tab back to my ubuntu desktop, the resolution doesn't change back, but stays at the game resolution.

I'm currently using a shellscript that changes the resolution back to my origional resolution (using xrandr -s 0)

Is it possible to check which window has focus using a shellscript.
If the game doesn't have focus change resolution to my origional resolution.

gnashley 11-08-2009 02:17 AM

maybe using xwininfo?

ta0kira 11-08-2009 01:44 PM

That doesn't seem to show any differences regarding focus, but thanks for pointing out the tool!
Kevin Barry

gnashley 11-08-2009 02:02 PM

Okay, I should have checked... but I was looking at some other stuff I have around here today and 'xdotool' can identify the window which has focus.


All times are GMT -5. The time now is 04:03 AM.