aboutsummaryrefslogtreecommitdiffstats
path: root/desktop/modules/status/test-notify-sound.sh
diff options
context:
space:
mode:
authorDanilo M. <danix@danix.xyz>2026-11-16 13:28:21 +0100
committerDanilo M. <danix@danix.xyz>2026-11-16 13:28:21 +0100
commita3fa6524b744ea062ea0197bb3a0fec7ec9c6b54 (patch)
tree32b0dfb8709ce46a0903d7ce916658047b3db617 /desktop/modules/status/test-notify-sound.sh
parentacc837d722d6905b47f0b673b84b02345867fb6e (diff)
downloadquickshell-a3fa6524b744ea062ea0197bb3a0fec7ec9c6b54.tar.gz
quickshell-a3fa6524b744ea062ea0197bb3a0fec7ec9c6b54.zip
status: nolamp mode and the agent-lamp forward
nolamp keeps agent-lamp's bulb dark; notify-sound forwards opencode's event and session to agent-lamp before the quiet check. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Diffstat (limited to 'desktop/modules/status/test-notify-sound.sh')
-rwxr-xr-xdesktop/modules/status/test-notify-sound.sh15
1 files changed, 14 insertions, 1 deletions
diff --git a/desktop/modules/status/test-notify-sound.sh b/desktop/modules/status/test-notify-sound.sh
index 9571d4c..d70893f 100755
--- a/desktop/modules/status/test-notify-sound.sh
+++ b/desktop/modules/status/test-notify-sound.sh
@@ -13,7 +13,8 @@
#
# The one runnable check for notify-sound. A fake paplay first on PATH
# records what it was asked to play, and XDG_RUNTIME_DIR is a temporary
-# directory, so no sound plays and the live quiet mode is untouched.
+# directory, so no sound plays and the live quiet mode is untouched. A fake
+# agent-lamp records its arguments, so the real lamp is never driven.
#
# Usage: ./test-notify-sound.sh (exit 0 = all passed)
@@ -27,6 +28,8 @@ export NOTIFY_SOUND_DIR="/sounds"
mkdir "$tmp/bin"
printf '#!/bin/sh\nprintf "%%s\\n" "$1" >> "%s/played"\n' "$tmp" > "$tmp/bin/paplay"
chmod +x "$tmp/bin/paplay"
+printf '#!/bin/sh\nprintf "%%s %%s\\n" "$1" "$2" >> "%s/lamp"\n' "$tmp" > "$tmp/bin/agent-lamp"
+chmod +x "$tmp/bin/agent-lamp"
export PATH="$tmp/bin:$PATH"
pass=0
@@ -64,5 +67,15 @@ check "quiet mutes permission" "" "$(play permission)"
"$here/statusctl" quiet set 0
check "quiet off plays again" "/sounds/claude-attention.opus" "$(play claude)"
+# Two arguments (opencode's event and session) are forwarded to agent-lamp,
+# even in quiet mode; Claude's single argument never is.
+rm -f "$tmp/lamp"
+"$here/notify-sound" claude
+"$here/notify-sound" permission ses1
+"$here/statusctl" quiet set 1
+"$here/notify-sound" complete ses2
+sleep 0.2
+check "lamp forward" "permission ses1|complete ses2" "$(paste -sd'|' "$tmp/lamp" 2>/dev/null)"
+
printf '\n%d passed, %d failed\n' "$pass" "$fail"
[[ "$fail" -eq 0 ]]