Results 1 to 3 of 3
Hi all,
Anyone happen to know of a way to set the focus to a particular window via a shell command? I have a perl application that invokes xine, then ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 01-02-2007 #1Just Joined!
- Join Date
- Jan 2007
- Posts
- 1
Setting focus via the command prompt?
Hi all,
Anyone happen to know of a way to set the focus to a particular window via a shell command? I have a perl application that invokes xine, then goes into a raw character mode to consume characters from the terminal. Unfortunately, when xine is invoked, the focus is switched out of the terminal window and I have to move the mouse in order to reestablish focus. Since the program is all about speed and efficiency, I do not want to have to do this. Any ideas? I'm assuming I'd start by using 'xwininfo' to establish the id of the window I want focus placed into, but once I have said id, what program do I pass it to? If there isn't one, I can obviously write a tiny little X app that will do it (which will probably take a few days of manual reading) or someone can send me the presumably 10 lines of code necessary and I'll be eternally grateful :- )
Hmmm. While I'm on this track, how about a means of moving the mouse to a particular position on the desktop via a command-line prompt? That would also do the trick, since I could just move the mouse into my window (and since I have 'focus-on-over' set, that should be sufficient).
Thanks in advance,
WadeLast edited by meta; 01-02-2007 at 10:06 PM. Reason: Try to figure out how to get the little blue ? to appear
- 01-03-2007 #2
The wmctrl program would be useful here.
Flies of a particular kind, i.e. time-flies, are fond of an arrow.
Registered Linux User #408794
- 01-03-2007 #3Linux Engineer
- Join Date
- Nov 2004
- Location
- Ft. Polk, LA
- Posts
- 796
wmctrl should do the trick
http://www.sweb.cz/tripie/utils/wmctrl/


Reply With Quote
