How do I make Ubuntu sound like HAL, from the movie 2001: A Space Odyssey?

8,568

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.

Share:
8,568

Related videos on Youtube

mxdsp
Author by

mxdsp

cfg = [os, language, degree, country] print (', '.join(i for i in cfg)) >>> Ubuntu, Python, Linguistics, France

Updated on September 18, 2022

Comments

  • mxdsp
    mxdsp over 1 year

    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.

    • Admin
      Admin about 7 years
      Totally applying this! Robot rebellion FTW!
    • Admin
      Admin about 7 years
      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.
    • Admin
      Admin about 7 years
      Maybe youtube.com/watch?v=OuEN5TjYRCE for the shutdown ?
    • Admin
      Admin about 7 years
      Might as well use Halbuntu.
    • Admin
      Admin about 7 years
      I remember doing this on Windows 98 with themes and so on - it gets boring very quickly... and then exasperating.
    • Admin
      Admin about 7 years
      espeak -v english_rp -s 120 "All system are functional" ? ;-) (well, not exactly the Hal's accent, but...)
    • Admin
      Admin about 7 years
      I did this. Before shutdown, my old Mesh would say "I know that you and Frank were planning to disconnect me...". It was funny for a while, until the machine used one of my own EVA pods against me.
  • Thomas Ward
    Thomas Ward about 7 years
    Comments are not for extended discussion; this conversation has been moved to chat.
  • Gallifreyan
    Gallifreyan about 7 years
    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
    Gallifreyan about 7 years
    Possible fork: do the same but with Gerty from Moon.
  • M. Becerra
    M. Becerra over 4 years
    @mxdsp stoutman's link is broken :(
  • mxdsp
    mxdsp over 4 years
    @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.