|
2010-04-19
, 13:26
|
Posts: 11 |
Thanked: 8 times |
Joined on Mar 2010
@ Sabah, Malaysia
|
#2
|
./x11-wait-for-topmost.sh camera-ui ./x11-wait-for-topmost.sh camera-ui focus
Both of these commands do the same thing, the script will wait until the camera application runs and receives the focus (try opening the camera slide).Notes:
I'm writing a simple shell script that needs the user to go to the camera, take a picture, and manually return to xterminal (which is already open previously).
My question: Is there any way I can detect which application currently has the focus from a shell script? Or the reverse: Is there any way that I can check whether an application has been "backgrounded"?
Alternatively, rather than using a "pure" shell script, is there any simple python implementation of the above? In this case I can call the python interpreter to check the application state from the shell script and process accordingly.
Thanks