[RESOLVED] Plug/Unplug sound on Ubuntu 22.04

Hey all,

I’ve got the AMD 13 with Ubuntu 22.04. It’s not really the end of the world but I can’t for the life of me figure out how to disable that little alert sound when I plug/unplug my laptop from power.

Anyone have any words of wisdom?

Run the following command in a terminal:

gsettings get org.gnome.desktop.sound theme-name
this will print the selected sound theme.

For me this will print 'freedesktop'.

Then go to /usr/share/sounds/freedesktop/stereo (replace freedesktop with your sound theme if it’s different) and rename or delete the power-plug.oga and power-unplug.oga there. (as root)

1 Like

Dang! I was so close to the answer. I didn’t even consider that the theme i was using might have it’s own sounds.

Jonathan’s approach would be mine as well.

Interesting find! Thank you. On my system I found the value is __custom and the corresponding directory is located at $HOME/.local/share/sounds/__custom. Not all sound files are there. Instead there’s index.theme which has a line in it that reads Inherits=freedesktop.
In that setup, you could probably silence a sound by putting a file filled with silence with the appropriate name in the __custom directory, to break inheritance. An advantage would be that you don’t end up scribbling over directories you shouldn’t be scribbling in (and where your scribbling could get undone by system updates).

1 Like

Yes, that could also work.

1 Like