aboutsummaryrefslogtreecommitdiffstats
path: root/notifications/Balloons.qml
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-10-19 10:12:33 +0200
committerDanilo M. <danix@danix.xyz>2026-10-19 10:12:33 +0200
commitbb595d78ee63198f3e8d7fede62f88c54f4a77b5 (patch)
tree5e276ac241787c7c518e7a8cd8632b8047c4ee3b /notifications/Balloons.qml
parent6ccdad992e7a62e92f3a67c3e370646f787aefd9 (diff)
downloadquickshell-bb595d78ee63198f3e8d7fede62f88c54f4a77b5.tar.gz
quickshell-bb595d78ee63198f3e8d7fede62f88c54f4a77b5.zip
notifications: quiet mode silences notification sounds too
Quiet muted only the Claude and opencode hooks, which play their own sounds and check the flag themselves. With notification sounds it now means no sound at all while the balloons still show, so the balloon player reads status.quiet the way Notify reads status.dnd, without instantiating Status. A per-app quiet list was left out: the mute list already covers an app that should make no sound. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'notifications/Balloons.qml')
-rw-r--r--notifications/Balloons.qml15
1 files changed, 14 insertions, 1 deletions
diff --git a/notifications/Balloons.qml b/notifications/Balloons.qml
index abeb13a..8574f9d 100644
--- a/notifications/Balloons.qml
+++ b/notifications/Balloons.qml
@@ -46,6 +46,19 @@ Scope {
// silent. seen is rebuilt from the queue each time, so it never grows.
property var seen: ({})
property bool primed: false
+ // Quiet mutes every sound and leaves the balloons, as it does for the
+ // Claude and opencode hooks. Read from the status registry's file, like
+ // Notify's dnd, so this shell never instantiates Status and its writes.
+ property bool quiet: false
+ FileView {
+ id: quietFile
+ path: (Quickshell.env("XDG_RUNTIME_DIR") || "/tmp") + "/status.quiet"
+ watchChanges: true
+ printErrors: false
+ onFileChanged: reload()
+ onLoaded: root.quiet = quietFile.text().trim() === "1"
+ onLoadFailed: root.quiet = false
+ }
Connections {
target: Notify
function onQueueChanged() {
@@ -61,7 +74,7 @@ Scope {
}
root.seen = next;
root.primed = true;
- if (file !== "") {
+ if (file !== "" && !root.quiet) {
// ponytail: one player, a new sound cuts the last; a queue of
// sounds if bursts ever need every one heard.
player.command = ["pw-play", file];