From c6dc2632c398d0fd889a8d116efbcffb18a6b712 Mon Sep 17 00:00:00 2001 From: rope Date: Tue, 26 May 2026 20:52:26 +0100 Subject: [PATCH] quickshell: add notification sound with app muting Co-Authored-By: Claude Opus 4.6 --- settings/hyprland.nix | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/settings/hyprland.nix b/settings/hyprland.nix index 8f94827..4c261e1 100644 --- a/settings/hyprland.nix +++ b/settings/hyprland.nix @@ -63,6 +63,7 @@ in quickshell qt6.qt5compat zenity + libcanberra-gtk3 ]; # Use upstream anyrun flake's HM module instead of the built-in one @@ -498,6 +499,7 @@ in readonly property string nmcli: "${nmcli}" readonly property string wifiConnect: "${wifiConnectScript}" readonly property string powerprofilesctl: "${powerprofilesctl}" + readonly property string notifSound: "${pkgs.libcanberra-gtk3}/bin/canberra-gtk-play" } ''; }; @@ -1722,6 +1724,7 @@ in text = '' import Quickshell import Quickshell.Wayland + import Quickshell.Io import QtQuick PanelWindow { @@ -1731,10 +1734,17 @@ in property var currentNotif: null property bool open: false + readonly property var mutedApps: ["discord", "Discord", "Spotify", "spotify", "vlc", "mpv"] + WlrLayershell.layer: WlrLayer.Overlay WlrLayershell.namespace: "quickshell-toast" exclusionMode: ExclusionMode.Ignore + Process { + id: notifSoundProc + command: [Commands.notifSound, "-i", "message"] + } + Connections { target: shellRoot function onNotificationReceived() { @@ -1747,6 +1757,9 @@ in visible = true; open = true; _toastTimer.restart(); + if (!mutedApps.includes(notification.appName)) { + notifSoundProc.running = true; + } } function dismiss() {