quickshell: add notification sound with app muting
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
031c8d2166
commit
c6dc2632c3
1 changed files with 13 additions and 0 deletions
|
|
@ -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() {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue