Compare commits

...
2 Commits
Author SHA1 Message Date
m3tam3re 9e96e92cfe Merge pull request 'fix(talk): cancel button now stops audio playback' (#21) from fix/talk-cancel-button into master
Reviewed-on: #21
2026-07-02 19:44:48 +02:00
m3ta-chiron c94ff86c12 fix(talk): cancel button now stops audio playback
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).
2026-07-02 19:43:53 +02:00
+1 -1
View File
@@ -93,7 +93,7 @@
$KILL "$NOTIFY_PID" 2>/dev/null || true $KILL "$NOTIFY_PID" 2>/dev/null || true
break break
fi fi
if [ -f "$ACTION_FILE" ]; then if [ -s "$ACTION_FILE" ]; then
if $GREP -q "cancel" "$ACTION_FILE" 2>/dev/null; then if $GREP -q "cancel" "$ACTION_FILE" 2>/dev/null; then
$KILL "$MPV_PID" 2>/dev/null || true $KILL "$MPV_PID" 2>/dev/null || true
fi fi