How to set the system bell sound that X11 uses by default?

I want to set the sound that is played on echo -e '\a'. I know I’ve done this before, but at the moment I cannot for the life of me figure out how to do it. I thought maybe xset, but as far as I can tell that can’t set the bell’s path.

For context, I am using X11 with qtile, and I’ve used the i3 community image, so there shouldn’t be any gnome or kde stuff sitting around.

I’ve already set .config/gtk-3.0/settings.ini which appears to work for canberra-gtk-play but not what the terminals play when you do echo -e '\a'.

I never tried nor even thought about the posibility to change that :woman_shrugging:

But… I guess you might try to use trace to find what is used/involved? :thinking:

Using my favorite search engine I only found references to pipewire that has some setting related to a soundfile for the system bell, maybe look at that? :woman_shrugging:

The error beep can be changed with xset to adjust beep volume, pitch and duration

xset(1) — Arch manual pages

The b option controls bell volume, pitch and duration…

If only one numerical parameter is given, the bell volume will be set to that value, as a percentage of its maximum. Likewise, the second numerical parameter specifies the bell pitch, in hertz, and the third numerical parameter specifies the duration in milliseconds

For more advanced configuration of PC Speaker, install package beep and check these sites for scripts to play a sequence of beeps
GitHub - NaWer/beep: ♫ A collection of bash scripts playing various music using beep ♫
GitHub - ShaneMcC/beeps: Linux beep music

If you are using PulseAudio the X11 bell can be replaced by a .wav or .ogg audio file
PulseAudio - X11 Bell Events - ArchWiki

PC speaker - ArchWiki

Gah, I knew it shouldn’t have been so hard, the real problem was that kitty seems to ignore pretty much everything that tries to set this other than its own config. I was going to switch back to wezterm soon anyway, which I think respects the sound theme from gtk-3.0.

So, for anyone else looking to do this, I recommend you do 3 things:

  • Set the GTK sound theme.
  • If using pulse audio set its bell sound.
  • Check if your terminal takes an explicit argument. alacritty and wezterm seem to respect the GTK settings, kitty does not.