l i n u x - u s e r s - g r o u p - o f - d a v i s
L U G O D
 
Next Meeting:
October 7: Social gathering
Next Installfest:
TBD
Latest News:
Aug. 18: Discounts to "Velocity" in NY; come to tonight's "Photography" talk
Page last updated:
2007 Nov 30 17:56

The following is an archive of a post made to our 'vox-tech mailing list' by one of its subscribers.

Report this post as spam:

(Enter your email address)
Re: [vox-tech] Setting foreground window from command line
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [vox-tech] Setting foreground window from command line



On Fri, 30 Nov 2007, Bryan Richter wrote:

On Nov 30, 2007 2:54 PM, Chris Jenks <jenks@re...> wrote:
   Hello,

   I'm looking for a way to cause a specific window to move to the
foreground when a shell script is run. My googling is returning very
little signal to noise! I'm running pretty much stock Gutsy ubuntu. Any
pointers?
First, it may help to know that while windows can ask to be moved to
the front, they are not guaranteed any benefaction on the part of the
window manager. So it might be impossible, unless you scripted the
window manager itself, and that's probably all sorts of annoying.
(Unless you're using a sweet window manager like Ion).

However, something that you may find useful are two Xterm resources:
popOnBell and bellIsUrgent. You can "man xterm" for details on them.
But basically your usage would be something like:

xterm -xrm "XTerm*popOnBell: true"
and/or -xrm "XTerm*bellIsUrgent: true"

and then in that xterm,

$ if its_time_to_run_the_script(); then
   # Ring the bell to ask to pop to front and set urgent flag
   echo -e "\a"
   run_the_script()
fi

If that works for you, there are other fun way to specify the
resources, rather than the command line, that you might find useful.

-Bryan
Dear Bryan,

It looks like this might be harder than I thought. The application I had in mind is something like this: use the motion package to look for changes in a video stream from a camera; when it sees some, it launches a script that moves a video display window to the foreground. The alert method you gave may be the best I can do, but it isn't ideal because other applications also ring the bell.

Yours,

Chris
_______________________________________________
vox-tech mailing list
vox-tech@lists.lugod.org
http://lists.lugod.org/mailman/listinfo/vox-tech



LinkedIn
LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
facebook
LUGOD Group on Facebook
'Like' LUGOD on Facebook:

Hosting provided by:
Sunset Systems
Sunset Systems offers preconfigured Linux systems, remote system administration and custom software development.

LUGOD: Linux Users' Group of Davis
PO Box 2082, Davis, CA 95617
Contact Us

LUGOD is a 501(c)7 non-profit organization
based in Davis, California
and serving the Sacramento area.
"Linux" is a trademark of Linus Torvalds.

Sponsored in part by:
O'Reilly and Associates
For numerous book donations.