92

Question:

I want Ubuntu to sound like HAL 9000, from the movie 2001: A Space Odyssey, by Stanley Kubrick. At least, I would like it to play sounds on :

  1. startup: "All systems are functional"
  2. shutdown: "I'm afraid that's something I can not allow to happen" / "Goodbye"
  3. upgrade: "I feel much better now. I really do."
  4. reboot: "Just one moment please."
  5. new email: "There is a message for you"

More:

  1. play a sound on first wrong sudo password prompt: "I'm sorry Dave. I'm afraid I can't do that"
  2. play a sound on second wrong sudo password prompt: "Just what do you think your doing, Dave?"
  3. play a sound when a coreutils command (like cp, dd) is going to take a long time to complete: "Just a moment. Just a moment." Maybe, some script with progress could work?
  4. play a sound after a coreutils command (or any command) took a long time to complete: "I'm sorry for the delay."
  5. play a sound along with unknown command error message: "I'm afraid I can't do that."

Coming next:

I'm waiting for more contributions, and I'll make a single script for all changes.

  • Totally applying this! Robot rebellion FTW! – Gallifreyan Mar 8 '17 at 14:20
  • This reminds me of my own quest to reinstate Aqua: see the webpage at CJSHayward.com/aqua. The Linux virtual machine no longer displays e.g. Aqua scrollbars due to automatic updates (I believe), but a purchase link is provided for Slow Leopard Server... I mean, Snow Leopard Server, which runs under virtual machines on Mac hardware. – Christos Hayward Mar 9 '17 at 13:43
  • Maybe youtube.com/watch?v=OuEN5TjYRCE for the shutdown ? – Olivier Dulac Mar 9 '17 at 14:46
  • Might as well use Halbuntu. – Daniel Mar 9 '17 at 17:24
  • 2
    espeak -v english_rp -s 120 "All system are functional" ? ;-) (well, not exactly the Hal's accent, but...) – Rmano Mar 10 '17 at 11:01
88
+500

Getting Ready

  • Download the HAL sounds and store them in a folder, let's say ~/audio/hal/
  • EDIT : as pointed by @M. Becerra in comments, stoutman.com is now broken. More HAL sounds are available in The 2001 Archive.
  • We are going to use function.wav, cantalow.wav, 1moment.wav, better.wav goodbye.wav, and message4u.wav (old sounds from stoutman.com, find your own custom sounds from the link above).
  • Of course, you can use many other sounds and customize your own HAL!
  • We will use paplay from the PulseAudio server, so there is nothing else to install.

1. Startup: "All systems are functional"

This section explains how to play a sound on session opening (source).

  • Create a .conf file in ~/.config/upstart/:

    gedit ~/.config/upstart/halsayshello.conf
    
  • Copy and paste this content:

    start on startup
    task
    exec paplay ~/audio/hal/function.wav
    
  • Save file, exit gedit, and HAL should now speak on next session opening.

2. Shutdown: " That's something I can not allow to happen..."

This section explains how to play a sound when a non-sudo user tries to use shutdown. The sudo -v command before paplay is here to ask the password prompt before playing a sound. If you don't care playing the sound before prompting for the password, you can delete it:

  • Add this line at the end of ~/.bashrc file:

    alias shutdown='paplay ~/audio/hal/cantalow.wav'
    
  • Yet, if you want the user to be able to shutdown, replace it by:

    alias shutdown='sudo -v && paplay ~/audio/hal/goodbye.wav && sudo shutdown'
    
  • Enable changes:

    source .bashrc
    

3. Upgrade: "I feel much better now. I really do."

This section explains how to play a sound after upgrading packages with apt:

  • Add this line at the end of ~/.bashrc file :

    alias upgrade='sudo apt update && sudo apt upgrade && paplay ~/audio/hal/better.wav'
    
  • Enable changes

    source .bashrc
    
  • You can now execute the upgrade command in your terminal

4. Reboot: "One moment please..."

This section explains how to play a sound before reboot.

  • Add this line at the end of ~/.bashrc file:

    alias reboot='sudo -v && paplay ~/audio/hal/1moment.wav && sudo reboot'
    
  • Enable changes:

    source .bashrc
    
  • You can now reboot using reboot instead of sudo reboot.

5. Email notification: "There is a message for you"

  • Move to default system sound folder:

    cd /usr/share/sounds/freedesktop/stereo
    
  • Backup default message notification sound:

    sudo mv message.oga message.oga.bak
    
  • Copy ~/hal/mesage4u.wav to replace it:

    sudo cp ~/audio/hal/mesage4u.wav message.oga
    

That's it

Well, of course these are just examples of what can be done. I wanted to share that funny configuration I set up, not on my computer, but on a home server (with speakers). Much more can be done or must be done if you want to play this sounds as root, or add others for more commands.

I'm exited about your ideas to improve it.

Enjoy your HAL and ... stay safe.

  • Comments are not for extended discussion; this conversation has been moved to chat. – Thomas Ward Mar 13 '17 at 0:58
  • 1
    1) Email notifications don't seem to work for Thunderbird. Had to use its own message sound manager for that. 2) Startup sound causes my system to be unresponsive for extra 6 to 8 seconds after startup (before the greeting is played). This isn't fatal, but somehow weird (especially for the first time) – Gallifreyan Mar 14 '17 at 19:05
  • 1
    Possible fork: do the same but with Gerty from Moon. – Gallifreyan Mar 14 '17 at 19:09
  • 1
    @mxdsp stoutman's link is broken :( – M. Becerra Aug 15 '19 at 8:58
  • 1
    @M.Becerra I've removed the stoutman.com link and added The 2001 Archive. If you find some more feel free to edit the answer. – mxdsp Sep 5 '19 at 8:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.