From 1f48d9808ce8e5fa7d0600d8e6322a9cf7a816b9 Mon Sep 17 00:00:00 2001 From: pants Date: Thu, 18 Dec 2025 00:25:59 -0800 Subject: [PATCH] ...ok now it actually works --- bin/mpd-monitor | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/bin/mpd-monitor b/bin/mpd-monitor index 5a09399..91af9ff 100755 --- a/bin/mpd-monitor +++ b/bin/mpd-monitor @@ -1,7 +1,11 @@ #!/bin/sh # quit if another instance is already running -[ -z $(pidof mpd-monitor) ] && echo "mpd-monitor already running";exit +if [ $(pidof mpd-monitor >/dev/null) ];then + echo "mpd-monitor already running" + exit +fi + ID=$(mpc current -f %id% ) mpc idleloop | while read -r event; do @@ -18,7 +22,7 @@ mpc idleloop | TITLE=$(mpc current -f %title%) ARTIST=$(mpc current -f %artist%) - if [ -z $TITLE ]; then + if [ -z "$TITLE" ]; then notify-send "End of queue or queue empty" -i : else notify-send "$TITLE" "$ARTIST" -i :