From c94ff86c1228712867c2c70cadf8b0d8659f91bc Mon Sep 17 00:00:00 2001 From: m3ta-chiron Date: Thu, 2 Jul 2026 19:38:54 +0200 Subject: [PATCH] fix(talk): cancel button now stops audio playback MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The shell '>' redirect creates ACTION_FILE immediately as an empty file. The poll loop checked [ -f ] (exists) instead of [ -s ] (non-empty), so it matched on the first 0.2s iteration, found no 'cancel' string, and broke out of the loop — leaving mpv running with no listener. [ -s ] only returns true once notify-send writes 'cancel' to the file (i.e. when the user actually clicks the Abbrechen action). --- pkgs/talk/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/talk/default.nix b/pkgs/talk/default.nix index 7260b85..46f6f23 100644 --- a/pkgs/talk/default.nix +++ b/pkgs/talk/default.nix @@ -93,7 +93,7 @@ $KILL "$NOTIFY_PID" 2>/dev/null || true break fi - if [ -f "$ACTION_FILE" ]; then + if [ -s "$ACTION_FILE" ]; then if $GREP -q "cancel" "$ACTION_FILE" 2>/dev/null; then $KILL "$MPV_PID" 2>/dev/null || true fi