Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 30 Aug 1998 08:49:17 -0500
From:      Zach Heilig <zach@gaffaneys.com>
To:        Kelly Yancey <kbyanc@freedomnet.com>, Joel Ray Holveck <joelh@gnu.org>
Cc:        freebsd-hackers@FreeBSD.ORG
Subject:   Re: determining an X window ID?
Message-ID:  <19980830084917.A4163@znh.org.>
In-Reply-To: <Pine.BSD/.3.91.980830052005.10995A-100000@freedomnet.com>; from Kelly Yancey on Sun, Aug 30, 1998 at 05:26:19AM -0400
References:  <199808300355.WAA05971@detlev.UUCP> <Pine.BSD/.3.91.980830052005.10995A-100000@freedomnet.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Aug 30, 1998 at 05:26:19AM -0400, Kelly Yancey wrote:
>   The old fashioned way...it checks for each of them in the output of ps 
> :)

>   Actually it's not too bad. I broke it into two loops: the first checks 
> for all the X-based cd players (xmcd, xcdplayer, etc), with the hope that 
> one day I'll be able to set focus on them. And the second checks for 
> command-line cd players (cdplay, cda, etc.)...I don't know what I could 
> do if they are running, but it definately isn't to try and start another 
> cd player :).

You could use 'egrep' instead of a for loop and grep:

#!/bin/sh
ps -cawx | egrep -w "xmcd|workman|xcdplayer|cda|cdplay" > /dev/null 2>&1
if [ $? -ne 0 ]; then
  xmcd $@ &
fi

/usr/sbin/cdcontrol can play cd's as well.

-- 
Zach Heilig -- zach@gaffaneys.com
Anyone who is capable of getting themselves made President should on no
account be allowed to do the job.
                -- Douglas Adams, "The Hitchhiker's Guide to the Galaxy"

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?19980830084917.A4163>