Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!garnett From: garnett@cs.utexas.edu (John William Garnett) Newsgroups: comp.sys.next Subject: Re: Attaching sounds to actions? Message-ID: <1053@tokio.cs.utexas.edu> Date: 23 Jan 91 04:54:47 GMT References: <985@kaos.MATH.UCLA.EDU> Distribution: na Organization: University of Texas at Austin Lines: 51 In article <985@kaos.MATH.UCLA.EDU> barry@pico.math.ucla.edu (Barry Merriman) writes: >Is there any way to attach sounds to system functions like >logout, killing a process, deleting a file, etc? > >I know Preferences can be used to set the system beep, but I'd like >finer control. (My machines name is Arnold---as in Schwarzenegger---which >opens up the possibility for a great many amusing voice annotations >for these functions. For example, on shutdown, I'd like it to >say ``I'll be back'', from the movie Terminator, and when I kill >a process, I'd like it to take the quote from Commando:``Remember when >I said I'd kill you last? I lied.'') > I think that you must be kidding, but just in case you aren't you could 1) write csh or sh shell scripts that first play a sound and then invoke a corresponding command. For example, you could write a shell script named "killer" that contained the following lines: kill $* sndplay /LocalLibrary/Sounds/killer.snd where killer.snd is a sound file that says whatever you want it to say (e.g. "Remember when I..."). Make sure to change killer to be executable (chmod +x killer). You should also put killer in a directory that is in your path. 2) write a NeXTstep front end to the utilities (kill, rm, etc.) and specify the appropriate sound files using inspector on the button that causes a given application to be executed. It might actually be useful to write this type of frontend to kill (who likes using ps to find a process id in order to kill something, much better to scroll through a list and then mouse select the process). 3) To attach a soundfile to system shutdown, you can move /etc/halt to /etc/halt.bin and then write a shell script like the following: sndplay /LocalLibrary/Sounds/shutdown.snd exec /etc/halt.bin -e -p Again, make sure that the /etc/halt script is executable. I haven't actually tried this - you may have to make /etc/halt a compiled C program and use the C routines analagous to sndplay and exec (the SND* routines and execl()) depending upon how the windowserver invokes /etc/halt. -- John Garnett University of Texas at Austin garnett@cs.utexas.edu Department of Computer Science Austin, Texas