...ok now it actually works
This commit is contained in:
@ -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 :
|
||||||
|
|||||||
Reference in New Issue
Block a user