From 9bd68d44a1cf111d129a31cae374bedd4dc88abc Mon Sep 17 00:00:00 2001 From: Josh Symonds Date: Mon, 18 May 2026 06:40:50 -0700 Subject: [PATCH] notifications: honor freedesktop suppress-sound hint (#2440) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Senders that play their own audio for a notification can set the standard org.freedesktop.Notifications "suppress-sound" boolean hint to ask the server not to double up. NotificationService skipped its sound only as a side effect of the dedup early-return (when an identically-keyed popup was still visible), so transient notifications double-sounded while lingering ones didn't — nondeterministic. Read notif.hints["suppress-sound"] and gate the AudioService call on it. --- quickshell/Services/NotificationService.qml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/quickshell/Services/NotificationService.qml b/quickshell/Services/NotificationService.qml index e8a38051..fe1a2536 100644 --- a/quickshell/Services/NotificationService.qml +++ b/quickshell/Services/NotificationService.qml @@ -656,7 +656,11 @@ Singleton { } } - if (SettingsData.soundsEnabled && SettingsData.soundNewNotification) { + // Honor the freedesktop "suppress-sound" hint: the sender + // plays its own audio for this notification and asks the + // server not to double up. + const suppressSound = !!(notif.hints && notif.hints["suppress-sound"]); + if (SettingsData.soundsEnabled && SettingsData.soundNewNotification && !suppressSound) { if (policy.urgency === NotificationUrgency.Critical) { AudioService.playCriticalNotificationSound(); } else {