Re: procmail script question
I would pipe the contents of echo to a shell script. In that
script you could test for xmms with something like the
following:
#!/bin/bash
xmms=`ps -ef | grep xmms | grep -v grep`
if [ "X$xmms" = "X" ]; then
# xmms not running
echo "$* | festival --tts"
else
# xmms running
xmms -u
echo "$* | festival --tts"
xmms -p
fi
I haven't tested this script or anything, but it (or
something close to it) should work. Put it in ~/bin, and
call it from your procmailrc script instead of festival.
(Make sure that ~/bin is in you path, or use the entire
path).
On Sun, Jul 22, 2001 at 02:43:30PM -0700, Lang Hurst wrote:
> I use the following procmail script to make festival speak the FROM and SUBJECT headings of new email through my speakers:
>
> SUBJECT=`formail -xSubject: \
> | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'`
> SENDER=`formail -xFrom: \
> | expand | sed -e 's/^[ ]*//g' -e 's/[ ]*$//g'`
> :0c
> | echo "New mail from " $SENDER ". the subject is " $SUBJECT | festival --tts
>
> That works great. However I am often listening to my vorbis collection. When my music is playing and a new email comes in, the festival output just gets garbled with the music. I would like to set up a procmail script that says
>
> if xmms is playing:
> xmms -u #pause xmms
>
> process new email
>
> if xmms was playing:
> xmms -p #start playing again
>
> I just don't know how to test for a process, and the two books I have on the subject are too basic, or I'm missing the page. Any help appreciated.
>
> -Lang
>
>
> --
> "Plan to throw one away. You will anyway."
> - Fred Brooks, "The Mythical Man Month"
>
>
> --
> To UNSUBSCRIBE, email to debian-user-request@lists.debian.org
> with a subject of "unsubscribe". Trouble? Contact listmaster@lists.debian.org
>
--
John Patton patton66@home.com
"Excess on occasion is exhilarating. It prevents moderation
from acquiring the deadening effect of a habit."
- W. Somerset Maugham
Reply to: