LinuxQuestions.org
Support LQ: Use code LQCO20 and save 20% on CrossOver Office
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Thread Tools
Old 11-07-2009, 01:55 PM   #1
robuust
LQ Newbie
 
Registered: Jul 2009
Posts: 11
Thanked: 0
shellscript to check if window has focus, possible?


[Log in to get rid of this advertisement]
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.
linuxubuntu robuust is offline     Reply With Quote
Old 11-08-2009, 03:17 AM   #2
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 3,697
Thanked: 103
maybe using xwininfo?
linux gnashley is offline     Reply With Quote
Thanked by:
Old 11-08-2009, 02:44 PM   #3
ta0kira
Senior Member
 
Registered: Sep 2004
Distribution: Slackware 11.0, Slackware 12.1, slamd64 12.2, Ubuntu Server 8.04, Kubuntu 9.04
Posts: 2,081
Thanked: 39
That doesn't seem to show any differences regarding focus, but thanks for pointing out the tool!
Kevin Barry
linux ta0kira is offline     Reply With Quote
Old 11-08-2009, 03:02 PM   #4
gnashley
Amigo developer
 
Registered: Dec 2003
Location: Germany
Distribution: Slackware
Posts: 3,697
Thanked: 103
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.
linux gnashley is offline     Reply With Quote
Thanked by:

Reply

Bookmarks


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Window Monitor Focus Ofc. Badiesel Linux - Newbie 1 05-03-2009 08:04 PM
click to focus window dynamicit Suse/Novell 0 08-01-2006 11:54 AM
New window focus in XFce xray_fl Programming 0 05-12-2005 03:05 PM
window focus thaprza Linux - Newbie 3 03-06-2005 04:25 PM
SDL window focus rebelcan Programming 1 10-06-2003 08:36 AM


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

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
RSS2  LQ Podcast
RSS2  LQ Radio
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: @linuxquestions
Open Source Consulting | Domain Registration