Setting up Sound Effects

So, I’ve had a google around and I can’t seem to find a simple way of configuring sounds triggered by events. Well, I tell a lie, I think I’ve found how to set login, logout, etc but not to the granularity that (shudder) Windows has.

I’ll say this now so that people are more than welcome to ignore me… I’m looking how to do this purely for fun. I’ve seen videos where sounds play whenever you plug in or remove a usb flash drive… dirty dirty anime sounds and they made me giggle like a schoolboy. Now it’s no longer about getting my computer to sound like a hentai soundboard but about the practical theory of HOW.

So, how do I trigger sounds/scripts/etc when a system event is raised?

Cheers!

https://specifications.freedesktop.org/sound-naming-spec/sound-naming-spec-latest.html

Sound files are here:
/usr/share/sounds/
or for user only:
~/.local/share/sounds/

https://wiki.archlinux.org/title/Libcanberra

Apps need to implement canberra otherwise you have to add it manually.

Thank you so much! I’m making some progress! I can make the sounds play with the command line and I know where the sound files are so I can replace individual files or create a new theme.

I’ve edited the .gtkrc-2.0 file to enable all the sounds but no joy yet, possibly requires a logout or restart (I’m supposed to be working atm so can’t really lol). Is there a command to force xfce to reload that settings file that you know of?

Again thanks!

Not that I know… normally it should be read the file when a new app has been launched.

If you use xfce with GTK3, then the config file is another one: GTK - ArchWiki

Check sound notifications are turned on and an appropriate sound theme has been selected

xfconf-query -c xsettings -lv | grep -i sound

and this to show the available sound effects

ls /usr/share/sounds/$(xfconf-query -c xsettings -p /Net/SoundThemeName)/stereo

Then the sounds can be tested with a command like this

canberra-gtk-play -i desktop-login

I haven’t tested but…

To get sound events to work in both Xubuntu and Arch:

  1. Enable “Event Sounds” in Settings Manager → Appearance → Settings
  2. Set “xsettings/Net/SoundThemeName” in the Settings Manager (to a sound theme located in /usr/share/sounds).
  3. Export GTK_MODULES=“canberra-gtk-module” (In Arch this was done automatically by install the libcanberra package, in Xubuntu I had to manually create the file: see http://ubuntuforums.org/showthread.php? … st12008205)
  4. Install the following packages: Arch (libcanberra libcanberra-pulse) Xubuntu (sox gnome-session-canberra)
  5. Turn up “System Sounds” in pavucontrol (Pulseaudio).