Ubuntu 18.04: Disable bell and alert sound on GNOME3 desktop environment

This article will describe a way to disable bell and alert sound on GNOME3 desktop environment.

1 About bell and alert sound

For example, when I try to delete character with Backspace key on GNOME Terminal, GNOME Terminal will make a sound if there is no input string.

Though GNOME Terminal tell me not to press Backspace anymore but I feel that this sound is annoying.

GNOME Terminal can stop to make a sound if unchecking "Terminal bell".

But there are applications which makes a sound but does not have "sound off" option.

While GNOME3 desktop environment provides "all sound off" option, this article makes off only bell and alert sound.

2 Disable bell sound

/usr/bin/start-pulseaudio-x11 will disable bell sound if bell.ogg is not exists.

#!/bin/sh


sudo mv /usr/share/sounds/ubuntu/stereo/bell.ogg \
     /usr/share/sounds/ubuntu/stereo/bell.ogg.orig
sudo reboot

3 Disable alert sound

Replace Drip.ogg of alert sound to be a silent ogg file.

#!/bin/sh


sudo mv /usr/share/sounds/gnome/default/alerts/drip.ogg \
     /usr/share/sounds/gnome/default/alerts/drip.ogg.orig
sudo apt install -y ffmpeg
sudo ffmpeg -f lavfi -i anullsrc -t 0.1 -c:a libvorbis \
     /usr/share/sounds/gnome/default/alerts/drip.ogg

Open "Settings". At the "Sound Effects" of "Sound", Set "Choose an alertsound" to "Drip" with double click (single click does not apply changes).

0001_DisableAlertSound.png