l i n u x - u s e r s - g r o u p - o f - d a v i s
Next Meeting:
July 7: Social gathering
Next Installfest:
Latest News:
Jun. 14: June LUGOD meeting cancelled
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:

   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
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"

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

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.


vox-tech mailing list

LUGOD Group on LinkedIn
Sign up for LUGOD event announcements
Your email address:
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:
Sunset Systems
Who graciously hosts our website & mailing lists!