Open Source Society Malta
0
  • About Us
    • About Malta
    • Statute of OSSMalta
    • Partners And Sponsors
    • Publish on OSSMalta
  • Jobs
    • Job Dashboard
    • Company Dashboard
    • Register a Company
    • Post a Job
    • Job Listing Companies
  • Events
    • My Events
    • Add an Event
  • Blog
    • LoRa
    • Education
    • Gaming
      • Retro
      • Steam
    • Hardware
      • AMD
      • D.I.Y Electronics
      • Electronic Boards
      • Intel
      • Mobile
      • Nvidia
      • PC & Laptops
      • Raspberry Pi
      • Tablet
    • How-To’s
    • Linux
      • Android
      • Mint
      • Ubuntu
    • Malta
    • Non-OSS
    • Security Update
    • Server
      • Webhosting
    • Video
  • Services
    • LoRa
    • Blacklists
    • Download
      • Desktop
      • The Chip Flash Collection
  • Sub-Sites
    • LoRa
    • Airline Manager 4 – Game Clan
    • Radio Waves
  • Contact
  • Member Login
    • Join Us
    • Profile

Useful Links

  • Maltese Spell Checker
  • Contribute to OSSMalta
  • Contact The Community
  • Privacy policy
info at ossmalta.eu
  • Maltese Spell Checker
  • Radio Waves
  • All Deals
  • AM4
  • Malta Craft (Minecraft)
Open Source Society Malta Open Source Society Malta
Open Source Society Malta Open Source Society Malta
  • About Us
    • About Malta
    • Statute of OSSMalta
    • Partners And Sponsors
    • Publish on OSSMalta
  • Jobs
    • Job Dashboard
    • Company Dashboard
    • Register a Company
    • Post a Job
    • Job Listing Companies
  • Events
    • My Events
    • Add an Event
  • Blog
    • LoRa
    • Education
    • Gaming
      • Retro
      • Steam
    • Hardware
      • AMD
      • D.I.Y Electronics
      • Electronic Boards
      • Intel
      • Mobile
      • Nvidia
      • PC & Laptops
      • Raspberry Pi
      • Tablet
    • How-To’s
    • Linux
      • Android
      • Mint
      • Ubuntu
    • Malta
    • Non-OSS
    • Security Update
    • Server
      • Webhosting
    • Video
  • Services
    • LoRa
    • Blacklists
    • Download
      • Desktop
      • The Chip Flash Collection
  • Sub-Sites
    • LoRa
    • Airline Manager 4 – Game Clan
    • Radio Waves
  • Contact
  • Member Login
    • Join Us
    • Profile
Open Source Society Malta > Linux > ubuntu > Audio > Enable Login & Log Out Sound in Ubuntu 24.04
AudioHow-ToHowtosLinuxlogin soundubuntu

Enable Login & Log Out Sound in Ubuntu 24.04

Posted by WarMax356 May 22, 2024
Shares
READ NEXT
KDE logo: blue rounded square with a white gear and a large white letter K inside it.
KDE Rounded Corners 0.10.0 Released with Gradient-Colored Outline
Contents
Step 1. The Command for playing the event sound:
Step 2. Enable Login Sound
Option 1: Add a Startup Applications
Option 2: Edit the GNOME Autostart Config file
3. Enable Log Out Sound
Play Shutdown Sound (Need Help)

This is a step by step guide shows you how to enable the event sounds (system sound or custom sound) for login and log out actions in Ubuntu 24.04 LTS.

When booting Ubuntu 24.04 from a live USB, it plays a sound after logged into the desktop. The sound however does no longer play after installed the system on your disk. So, here I’m going to show you how to re-enable this feature.

NOTE: This tutorial is tested and works in my case in Ubuntu 24.04. It MAY also work in old Ubuntu releases and even other Linux, but for GNOME Desktop only.

Step 1. The Command for playing the event sound:

NOTE: This step is ONLY required for those who want to play a custom sound, instead of system default.

Ubuntu, definitely GNOME, uses libcanberra for event sound playback. The default Login Sound is played by the command below:

/usr/bin/canberra-gtk-play --id="desktop-login" --description="GNOME Login"

While, the log out sound is handled by command:

/usr/bin/canberra-gtk-play --id="desktop-logoff" --description="GNOME Log Out"

Tips: press Ctrl+Alt+T to open terminal, paste and run the commands above to try the sounds playback. Though, you need to enable event sound first, by going to Settings -> Sound -> Sounds -> Alert Sound in 24..04.

To configure what sound to play, you just need to change the value of --id in the commands above.

For the default sound theme, just go to /usr/share/sounds/Yaru/stereo in file manager, then you’ll see all the available event sound ids (file-names without the .oga extension).

For example, play battery low sound via:

/usr/bin/canberra-gtk-play --id="battery-low" --description="whatever text as you want"

NOTE: If you switched sound theme to “Default”, then go /usr/share/sounds/freedesktop/stereo/ for sound IDs.

Event sound audio files

If you downloaded a sound file from web, or made an audio by yourself, then use the command below instead for playback:

/usr/bin/canberra-gtk-play --file="/home/ji/Music/sounds/123.wav" --description="whatever text as you want"

Replace /home/ji/Music/sounds/123.wav with PATH to your audio file. For short sound, add --loop=3 can play it for multiple times.

Step 2. Enable Login Sound

For the login sound, either add a startup application for running the command at login for current user, or configure the login sound .desktop that works for all users.

NOTE: /usr/bin/canberra-gtk-play does NOT work if event sound (Alert Sound) disabled! If you want to play login sound but NO event sound, use mpv or other audio player instead in 2 Options below:

And, here’s the command to play login sound using mpv media player (Run sudo apt install mpv to install it first):

mpv /usr/share/sounds/Yaru/stereo/desktop-login.oga

Option 1: Add a Startup Applications

First, press Super (Windows Logo) key on keyboard to trigger overview, then search for and launch “Startup Applications“.

When the tool opens, click “Add” button to add a new startup app at login. Then, insert:

  • Name: type whatever name as you want.
  • Command: /usr/bin/canberra-gtk-play --id="desktop-login" --description="GNOME Login"
  • Comment: whatever text, or leave blank.

You may replace the command according to last step for custom sound. But, it’s BETTER to run the command in terminal (Ctrl+Alt+T) first to ensure it works!

Option 2: Edit the GNOME Autostart Config file

The libcanberra library in Ubuntu has a config file for login sound event. The sound playback is however disabled out-of-the-box.

To enable this feature, simply open terminal (Ctrl+Alt+T) and run command to edit the config file:

sudo gnome-text-editor /usr/share/gnome/autostart/libcanberra-login-sound.desktop

For Ubuntu 22.04 and earlier, replace gnome-text-editor with gedit.

When file opens, just set “X-GNOME-Autostart-enabled=true“, and change the command for “Exec” line if you want to set a custom sound.

After saving the file, login sound should play for all users with event sound (Alert Sound) enabled!

3. Enable Log Out Sound

GNOME also has a config file for log out sound playback. It’s libcanberra-ready-sound.desktop file under “/usr/share/gdm/autostart/LoginWindow” directory, which however does NOT function out-of-the-box.

In my test, moving the file into /usr/share/gdm/greeter/autostart/ makes it work for log out and boot-up into login screen in Ubuntu 24.04.

Enable Log Out sound via the steps below will work even when event sound (Alert Sound) disabled in per user basis!

1. First, press Ctrl+Alt+T on keyboard to open up a terminal window. When terminal opens, run command to edit the file:

sudo gnome-text-editor /usr/share/gdm/autostart/LoginWindow/libcanberra-ready-sound.desktop

By default, it uses “system ready” sound, which is totally same to the login sound (desktop-login) in Ubuntu! So, I changed it to “desktop-logoff”. For choice, you can replace the command to custom sound playback.

2. After saved the file, run command to copy it into /usr/share/gdm/greeter/autostart/ directory:

sudo cp /usr/share/gdm/autostart/LoginWindow/libcanberra-ready-sound.desktop /usr/share/gdm/greeter/autostart/

If you changed your mind, just run command to delete that file, thus log out sound will be disabled:

sudo rm /usr/share/gdm/greeter/autostart/libcanberra-ready-sound.desktop

Play Shutdown Sound (Need Help)

There’s also a shutdown script, under /usr/share/gnome/shutdown directory, in Ubuntu 24.04. However, I don’t figure out how to enable it for playing a sound at shutdown.

For Arch Linux, libcanberra is built with following sevices:

  • canberra-system-shutdown.service
  • canberra-system-bootup.service
  • canberra-system-shutdown-reboot.service

Just enable the services should play sound in corresponding events. However, the library in Ubuntu is built without them.

I’ve also tried custom systemd service, but with no luck. If you know how to play a sound at shutdown in Ubuntu 24.04, please leave comment below.

author avatar
WarMax356 Founder
See Full Bio
social network icon
Tags: Curated How-tos linux ubuntu

What’s your reaction?

Love
0
Sad
0
Happy
0
Sleepy
0
Angry
0
Dead
0
Wink
0
Shares
Share on Facebook Share on X Share on Pinterest Share on Email
WarMax356 May 22, 2024
Previous Article Install LibreOffice Office Suite in Ubuntu 24.04
Next Article Set up Google Drive for Local Folder Sync in Ubuntu 24.04

Advertisment:

Hosting & Technical Support Sponsor

Advertisement

You Might Also Enjoy

KDE logo: white gear with a K on a blue rounded square background.
How-ToKDELinuxNewsubuntu

KDE Gear 26.08 Released with Tons of New Features & Improvements

<div>KDE Gear 26.08, the new release of KDE’s official collection of applications, is available after four months of development. The new version of this KDE app collections includes many new features and improvements to the Dolphin file explorer, KDE connect, Kdenlive video editor, Konsole terminal emulator, and others. Dolphin The Dolphin file explorer app has […]</div>

August 24, 2026
Three interlocking gears in red, blue, and green against a black background.
How-ToLinuxMesa 3D graphics libraryNewsubuntu

Mesa 26.2.1 Released with A Large Collection of Bug Fixes

<div>Mesa 3D graphics library released 26.2.1 version a few days ago, making the new 26.2 release series stable enough for production use. Mesa announced 26.2.0 a few weeks ago with many exciting new features. Now, it’s ready for use by the first 26.2.1 bug fix update. Mesa 26.2.0 is a new development release. People who […]</div>

August 23, 2026
Blue circle Steam logo with a white stylized valve graphic.
gameHow-ToLinuxNewsubuntu

Proton 11.0-2 Released! Supports Playing 9 More Games in Linux

<div>Proton, Valve Software’s tool for running Windows games in Linux through Steam, released new 11.0-2 version a few days ago. The new version of this popular Wine based software makes 9 more games playable in Linux! The new playable games in Linux through Proton include: AsteroidsHD, a arcade-style space combat game features single-player, multiplayer, real-time […]</div>

August 23, 2026
Solid black square image (placeholder/texture)
GnomeHow-ToHowtosLinuxubuntu

This Extension Displays Your Photo Images as Desktop Widget

<div>Want to display your lovely photo images as desktop widget, here’s an extension that can do the job for Ubuntu and other Linux with recent GNOME Desktop. It’s Desktop Frames, a GNOME Shell extension that can create multiple desktop widgets that display random images from user selected folders. It is a remake of the original […]</div>

August 20, 2026

Open Source Society Malta

A Malta-based community for the Open-Source Initiative, find out more here.

Community support is available by Contacting us online

Stay up-to-date

Sign up to our newsletter
We hate spam too! - you'll just get our newletter updates based on your settings

Newly listed Jobs

  • GIG

    Senior Big Data Engineer

    • Malta
    • GIG
    • Full Time
  • 2026-237 – Technical Architect

    • Anywhere
    • Full Time
  • Heritage Malta

    Coordinator (Collections Management)

    • Malta
    • Heritage Malta
    • Full Time

Supported by:

 
MEYN Energy
SEEED Studio
Software Heritage
GO PLC
TrueNAS
Ubuntu | Canonical
OPNSense
 
Open Source Society Malta Open Source Society Malta
Some rights reserved - Designed by Warmax356

Our website uses cookies to improve your experience. Learn more about: Cookie Policy

Accept