Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!att!linac!midway!midway!scott From: scott@sage.uchicago.edu (Scott Deerwester) Newsgroups: comp.sys.next Subject: Re: Printer power on-off --- Announce mail arrival. Message-ID: Date: 29 Jan 91 12:57:25 GMT References: <5671@idunno.Princeton.EDU> <5705@idunno.Princeton.EDU> <1235@toaster.SFSU.EDU> Sender: news@midway.uchicago.edu (News Administrator) Distribution: usa Organization: /Users/scott/.organization Lines: 70 In-Reply-To: scott@sage.uchicago.edu's message of 28 Jan 91 11:59:31 To try to staunch the flow of email requests on how you do this, here's how to get the NeXT to play a user-specific sound bite when mail from that user arrives. I think I remember getting this from Steve somebody at UIUC from this news group. [Do we have a FAQ file in this news group? Can somebody remind me why Fontographer- generated PostScript fonts don't work and how to fix it?] First, edit or create a .forward file that looks like this: --- CUT HERE --- scott@sage.uchicago.edu, |/Users/scott/Apps/newmail --- END --- modified, of course. Next, edit the following with the correct directory: ---- CUT HERE --- #!/bin/sh DIR=/Users/scott/Sounds if test -f /usr/bin/sndplay -a -r /dev/console then from=` /usr/ucb/grep -i '^From:' | /usr/bin/tr 'A-Z' 'a-z' | /usr/ucb/head -1 | /bin/sed ' s/[^ ]* // s/.*.*// s/([^)]*)// s/[@%].*// s/ .*// ` if test "$from" != "" -a -r $DIR/$from".snd" ; then /usr/bin/sndplay $DIR/$from".snd" else /usr/bin/sndplay $DIR/mail.snd fi fi exit 0 --- END --- Make it executable and put it in your Apps directory. Then start recording sound bites. Some advice on sound bites; record one that you'll get when it's from somebody you don't know and name it mail.snd. Mine says "Pssst!". You could also record mailer-daemon.snd, which will get played when your mail gets bounced. I've got sound bites for a total of 35 logins. You want to be a little careful about your sound bites. You'll hear these a lot. Eric Scott's point that you only want to have this happen if you're logged in is certainly valid. The "test ... -r /dev/console" means that this will only happen if you're logged in on the console. I suppose that you could also shut it up by doing something like: if test -f $DIR/.quiet ; then echo elif test "$from" != "" -a -r $DIR/$from".snd" ; then /usr/bin/sndplay $DIR/$from".snd" else /usr/bin/sndplay $DIR/mail.snd fi -- Scott Deerwester | Internet: scott@tira.uchicago.edu | ~{P;N,5B~} Center for Information and | Phone: 312-702-6948 | Language Studies | 1100 E. 57th, CILS | University of Chicago | Chicago, IL 60637 |