Re: FVWM: Audio with fvwm

From: Albrecht Kadlec <albrecht_at_auto.tuwien.ac.at>
Date: Fri, 13 Dec 96 15:08:37 +0100

>>>>> Mike A Harris writes:

M> I'd like to assign audio files to different events in fvwm. Is it
M> possible?
it is for fvwm events (FvwmAudio module)


M> If so how? For example: How would I set it up so that when
M> I get incoming mail a file called you_have_mail.au is played?
mail arrival is not an fvwm event.
But when mail is received, the demon looks for ~/.forward.
Usually a mail forward address is put there, but you can also start a
command from there.
Make this a batchfile and put some playaudio command there (or better
send a command to your fvwm to play sth, since another user would be
quite surprised if the demon was invoked while you're not there.)

So:
~/.forward:
|~albrecht/.mailfilter


~/.mailfilter (shortened):
#!/usr/local/lbin/tcsh -f
#
# Mail filter for various mail services with vaction support.
#
############### CONFIGURATION SECTION ###################################
#
# USER DATA
# must be set because $USER is 'root' and $HOME is the home dir. from 'root'
#

setenv USER albrecht
setenv HOME ~albrecht


#########################################################################
umask 077
set tmpf=/tmp/mail_$$

# copy stdin (piped in from .forward) to tmpfile to work on
cat >$tmpf


#########################################################################
#
# grep for mailing list adresses and copy to separate files
#
#########################################################################

egrep -s -e '^Sender: owner-fvwm-workers_at_' $tmpf
if ($status == 0) then
  cat $tmpf >> $HOME/fvwm2worker
  goto cleanup
endif

egrep -s -e '^Sender: owner-fvwm_at_' $tmpf
if ($status == 0) then
  cat $tmpf >> $HOME/fvwm2
  goto cleanup
endif

#########################################################################
#
# NORMAL MAIL
#
#########################################################################

cat $tmpf >> /usr/spool/mail/$USER

# this is to prepare fetching mail (not mailing lists) via modem - FAST !!!
/usr/local/bin/zip -k9 $HOME/mail.zip $tmpf

cleanup:

/bin/rm -f $tmpf

exit 0












so simply add

        if [ -p ~/.fvwmpipe ] then
        # or any other test to check if fvwm2 is running under your account
        # e.g exit code of: ps -axu | grep $User | grep fvwm2

                playaudio $HOME/mail_has_come_my_master.au

        # If your host is not the host receiving mail, you should
        # better send the command to fvwm2 for execution (via FvwmPipe)
                echo exec playaudio $HOME/mail_has_come_my_master.au >>~/.fvwmpipe
        endif

on the top.


hope this helped,
albrecht
-- 
Well I've always had a deep respect, and I mean that most sincerely.
The band is just fantastic, that is really what I think. Oh by the way,
   which one's Pink?						-- Pink Floyd
--
Visit the official FVWM web page at <URL:http://www.hpc.uh.edu/fvwm/>.
To unsubscribe from the list, send "unsubscribe fvwm" in the body of a
message to majordomo_at_hpc.uh.edu.
To report problems, send mail to fvwm-owner_at_hpc.uh.edu.
Received on Fri Dec 13 1996 - 08:11:28 GMT

This archive was generated by hypermail 2.3.0 : Mon Aug 29 2016 - 19:37:59 BST