From 56383af7417e9eddc1c9d5763c3e63e32530612c Mon Sep 17 00:00:00 2001 From: pants Date: Wed, 17 Dec 2025 20:33:32 -0800 Subject: [PATCH] make tremendous --- bin/mpd-monitor | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/mpd-monitor b/bin/mpd-monitor index 7f20022..5a09399 100755 --- a/bin/mpd-monitor +++ b/bin/mpd-monitor @@ -1,4 +1,7 @@ #!/bin/sh + +# quit if another instance is already running +[ -z $(pidof mpd-monitor) ] && echo "mpd-monitor already running";exit ID=$(mpc current -f %id% ) mpc idleloop | while read -r event; do @@ -7,7 +10,7 @@ mpc idleloop | # get current id to compare to init id NEW_ID=$(mpc current -f %id%) - # if a player even is output, but the track has not changed, skip rest of loop + # if a player event is output, but the track has not changed, skip rest of loop [ "$NEW_ID" != "$ID" ] || continue ID=$NEW_ID