Path: utzoo!attcan!uunet!wuarchive!usc!ucla-cs!math.ucla.edu!barry@pico.math.ucla.edu From: barry@pico.math.ucla.edu (Barry Merriman) Newsgroups: comp.sys.next Subject: Re: Attaching sounds to actions? Message-ID: <992@kaos.MATH.UCLA.EDU> Date: 23 Jan 91 22:16:57 GMT Sender: news@MATH.UCLA.EDU Distribution: na Organization: UCLA Dept. of Math, UCLA Inst. for Fusion and Plasma Research Lines: 84 Here's the answer about how to attach sounds to actions---its the Unix way, of course! Lets assume you store all your sounds in /me as .snd files. Then you'd do the following: Login sounds ------------ Put playsnd /me/my_login_sound.snd in you .login file Logout sounds ------------ Put playsnd /me/my_logout_sound.snd in your .logout file Sounds attached to commands --------------------------- too attach foobar.snd to the command foobar, make the following alias in your .cshrc file: alias foobar 'playsnd /me/foobar.snd ; /bin/foobar' NOTE: you must put the full path name of foobar (here assumed /bin/foobar) in the alias to avoid a self-referential alias. Complications: ------------- If you work in a heterogenous environment---say suns and NeXTs, then you need to put conditional statements in front of all the above commands, conditioning on whether you are logged into the NeXT. A crude way to do this is if(`hostname` == my_next_hostname ) But this is clumsy if you have many NeXTs. A better way is to see if the NeXT files are present, and use this to deside. E.g., if ( -e "/.NeXT" ) checks for the existence of the /.NeXT directory. Q: is there a command that returns "next" as a machine type, analogous to the sun `arch` command? If so, use this to query the machine type. Bugs ---- These sounds don't get executed by the system though---for e.g., if you attach a sound to "kill", and then use the Processes panel to kill an App, it doesn't use your kill. Even if you put it in the root .cshrc. I suppose you would have to su to root and change the kill command to a script that read your sound prior to kill---but thats a little hacky. Getting sounds -------------- Well, this is up to you. You can always record them through the built in mike using SoundPlayer---though these are of lesser quality. If anyone out there has a high quality (digital ears) recording setup, I'm looking for a few good Arnold Schwarzenneger quotes. For the moment, I'm making do with my Arnold imitation, which eventually I'll replace with Arnold himself, via the builtin mike. If anyone has a digitial ears setup, post some good sounds to the archives. Have fun. -- Barry Merriman UCLA Dept. of Math UCLA Inst. for Fusion and Plasma Research barry@math.ucla.edu (Internet)