Notification sounds and system sounds on Linux should be granular

April 11, 2023

A while back I wrote about silencing KDE application notification sounds under fvwm, where the solution was to open up the desktop settings or volume control application of your choice and turn off the volume of what is variously called 'Notification Sounds' or 'System Sounds'. Initially I did this through KDE and thought it was a KDE-specific setting, but as pointed out to me in comments, this is actually a global (to the system) sound stream for system sounds and events. This is an extremely blunt hammer to deal with unwanted notification sounds, and Linux should do better. In practice this means both programs and desktop toolkits, such as KDE and GTK.

Modern mobile devices show what's possible and what we should be able to get on Linux. Mobile OSes such as iOS support mandatory system level control over whether each application can use sounds (or other things) in their notifications. Better applications also provide granular control over what noises they may optionally make, including 'none'. Of course there's a place for a global control, but it should be your last resort if your issue is with a specific application making unwanted noises, especially for non-urgent things.

(Some people will want their computer to make no noises at all, but others may want to preserve some system sounds for, for example, urgent issues or alerts.)

The state in current desktops (in Fedora 37) seems somewhat mixed. Cinnamon gives you control over what sounds its desktop shell makes, but not over what notification sounds its applications generate (never mind applications from other desktops). GNOME, in its 'Notifications' section, offers specific controls over sound usage by notification by application, but only for GNOME applications. If you dig deep enough in KDE settings, KDE seems to have quite fine grained control over notification sounds from certain KDE applications, but this doesn't seem to include applications that are merely KDE-based, like kdiff3.

If GNOME's notification sound setting worked for everything, it would have basically the interface I'd want (and be very similar to what iOS and I believe Android support, which may not be a coincidence). However, achieving this would probably require everyone to agree on some sort of standard for notifications, either in the form of 'send your notification stuff here to a daemon that will actually make them appear' (and then the daemon could filter things), or for exposing and configuring notification settings for arbitrary programs.

Until such a beautiful day comes to pass, Linux sound notifications will continue to be an irritating mess and probably irritate people when some random program suddenly bings and bongs at them. The likely consequence of this is that more people turn off system sounds entirely.


Comments on this page:

I don't have a single application installed that makes notif noises. I didn't realise how calming this was until I read your article, that sounds really annoying.

What sort of stuff is beeping and booping at you? Chat apps maybe?

Thunderbird used to have this as an optional feature for notifs, but this feature broke ages ago anyway :P

From 193.219.181.219 at 2023-04-12 02:36:50:

GNOME, in its 'Notifications' section, offers specific controls over sound usage by notification by application, but only for GNOME applications

I think this technically does work for everything, as it controls the behavior of the notification daemon that's part of GNOME Shell (rather than controlling apps directly), but it only lists those applications which have opted in to being listed using X-GNOME-UsesNotifications=true in their .desktop files. (They chose to do this to make the list less cluttered, from what I remember.)

From 193.219.181.219 at 2023-04-12 02:39:05:

(The problem, of course, is that Linux never had anything to force apps to declare upfront that they will be sending notifications; they could always just fire off the D-Bus method call without any restrictions. Command-line tools might not even have a .desktop file.)

By Daniel Harding at 2023-04-12 04:59:22:

XFCE's notification daemon, xfce4-notifyd, simply keeps tracks of applications that have sent notifications previously and allows basic per-application configuration for those applications, including muting. It suffers from a slightly different problem in that the application list on my system showed duplicate entries for some applications (presumably due to a change in some internal name or identifier) with no indication which had been active more recently, as well as entries for applications that are no longer installed on my system. Fortunately it does allow for manual removal of obsolete entries so I was able to clean up the list by hand. But is seems preferable to have some obsolete entries in the list than to not allow managing notifications for applications that haven't explicitly been opted in.

By cks at 2023-04-12 12:06:37:

The application I ran into this with is kdiff3, when invoked by Mercurial to merge changes. It makes a noise on startup (and forcefully shoves a modal alert in front of you, which is real fun when you did the 'hg pull -u' in a window off in the corner and didn't at all expect a forced merge).

Various desktop environments also default to making noises when you do various window events, but I always turn that off in things like Cinnamon (when I use Cinnamon) the moment I notice. My normal odd fvwm-based session is normally silent unless I'm actively playing something.

Written on 11 April 2023.
« Failing to build a useful pre Go 1.21 static Go toolchain on Linux
The chain of landing web pages that I saw for a phish spam today »

Page tools: View Source, View Normal.
Search:
Login: Password:

Last modified: Tue Apr 11 22:43:27 2023
This dinky wiki is brought to you by the Insane Hackers Guild, Python sub-branch.