...ok now it actually works

This commit is contained in:
2025-12-18 00:25:59 -08:00
parent 56383af741
commit 1f48d9808c

View File

@ -1,7 +1,11 @@
#!/bin/sh #!/bin/sh
# quit if another instance is already running # 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% ) ID=$(mpc current -f %id% )
mpc idleloop | mpc idleloop |
while read -r event; do while read -r event; do
@ -18,7 +22,7 @@ mpc idleloop |
TITLE=$(mpc current -f %title%) TITLE=$(mpc current -f %title%)
ARTIST=$(mpc current -f %artist%) ARTIST=$(mpc current -f %artist%)
if [ -z $TITLE ]; then if [ -z "$TITLE" ]; then
notify-send "End of queue or queue empty" -i : notify-send "End of queue or queue empty" -i :
else else
notify-send "$TITLE" "$ARTIST" -i : notify-send "$TITLE" "$ARTIST" -i :