2

I'm on Ubuntu 20.04.3 LTS with GNOME Desktop. I was wondering if you can have a custom sound play (the default one is nice, but I'd rather have a custom one) when you log into Ubuntu, as well as when you log out.

I've gotten a nostalgia rush from when I used to use Windows XP in 2008-ish on a Dell Optiflex with the Royale Noir theme for log on and the Windows Vista Beta 2 for logout, and genuinely want to know if you can do this.

All related questions are mostly 8 years old and have Ubuntu 12.04/14.04.

sgal5208
  • 127

2 Answers2

2

There are several ways of doing that, depending on the moment you want the sound to play.

A possible command to play a sound is mplayer <file>.

You could setup a cron job that plays the sound upon boot, for instance, and that will work the same for all users.

$ sudo crontab -e

to edit the crontab file, and add a line with

@reboot mplayer <file>

For the complete set startup/shutdown/reboot:

  1. For pre-systemd, use this.
  2. For systemd, use this, this, and check other linked sources.

Related

  1. https://smallbusiness.chron.com/run-command-startup-linux-27796.html
2

I hope you're doing well.

I see in one of your comments that you're not too keen on using the terminal, but this here link has all the commands required to set a custom shutdown sound. Take a look at the highest upvoted answer, you can copy and paste this into your terminal.

Even though this comment is old, like you have mentioned in your question, it should work.

Bare in mind, as you may know, the usual copy/paste shortcut is CTRL+C & CTRL+V. This will not work in terminal; instead, use CTRL+SHIFT+C and CTRL+SHIFT+V for copy and paste respectively.

If you look at this part of the given link:

here's the content of the script:

## play shutdown sound
/usr/bin/mpg123 /path/to/your/shutdown.mp3

The /path/to/your/shutdown.mp3 is the pathname to wherever your custom sound file is stored. You can find this pathname through File Manager > Right Click on File > Properties.

If you have any trouble with this, I can link my Discord and help you set it up.

Yours, Bubbles.

Bubbles
  • 61