Boston Linux & Unix (BLU) Home | Calendar | Mail Lists | List Archives | Desktop SIG | Hardware Hacking SIG
Wiki | Flickr | PicasaWeb | Video | Maps & Directions | Installfests | Keysignings
Linux Cafe | Meeting Notes | Blog | Linux Links | Bling | About BLU

BLU Discuss list archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Checking for running apps in X



I recently got the extra buttons on my keyboard working so sawfish can 
launch
my mail reader from a single button. It does this by binding a shell 
command
to the key. It works great, except that if my mail reader is already 
running,
it starts up a new instance.

I'd like to be able to detect if my mail reader is already running, and
if so, raise its window instead of starting a new instance. I can't rely
on ps for this, as I may have another instance running on another machine.
Exmh acts as a front-end for nmh, so I can run multiple instances with
no real problems (just a minor cosmetic itch where I may have to refresh 
the display of the inbox queue when going back to the older instance).

Anyway, I guess I'm asking two things:

1) How do I check, from the command line, if there's already an instance 
of a given program running in the current X display, and

2) How do I signal a window to deiconify and raise itself, from the
command line?

For example, mozilla has this capability: 
    "mozilla -remote openurl(http://foo.com,new-window)"


--
John Abreau / Executive Director, Boston Linux & Unix 
ICQ 28611923 / AIM abreauj / JABBER jabr at jabber.org / YAHOO abreauj
Email jabr at blu.org / WWW http://www.blu.org


-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 1669 bytes
Desc: not available
URL: <http://lists.blu.org/pipermail/discuss/attachments/20011025/b11604d9/attachment.sig>



BLU is a member of BostonUserGroups
BLU is a member of BostonUserGroups
We also thank MIT for the use of their facilities.

Valid HTML 4.01! Valid CSS!



Boston Linux & Unix / webmaster@blu.org