From 5694c1ee3946ed7c0645d885f175d4a1e197b736 Mon Sep 17 00:00:00 2001 From: William Bell <62452284+Ugric@users.noreply.github.com> Date: Sat, 3 Jan 2026 14:49:12 +0000 Subject: [PATCH] stop all when the soundboard is stopped --- stop_soundboard.sh | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/stop_soundboard.sh b/stop_soundboard.sh index 6f346b6..0f771c6 100755 --- a/stop_soundboard.sh +++ b/stop_soundboard.sh @@ -2,7 +2,19 @@ STATE="$HOME/.soundboard" -exec ./stop_all.sh +[[ -f "$STATE/playing.pids" ]] || exit 0 + +while read -r PID; do + # Check if process exists before sending SIGINT + if [[ -n "$PID" ]] && kill -0 "$PID" 2>/dev/null; then + kill -INT "$PID" 2>/dev/null || true + fi +done < "$STATE/playing.pids" + +# Clear the PID file after attempting to stop everything +rm -f "$STATE/playing.pids" + +echo "All soundboard playback stopped." # 2. Restore default mic BEFORE unloading modules DEFAULT_MIC=$(pactl info | grep "Default Source" | awk '{print $3}')