aboutsummaryrefslogtreecommitdiffstats
path: root/mpdnotify/run
diff options
context:
space:
mode:
authorSquibid <me@zacharyscheiman.com>2024-08-04 02:12:04 -0400
committerSquibid <me@zacharyscheiman.com>2024-08-04 02:12:04 -0400
commit84f3886d289dccefd965d05b4e17f245d3a309b9 (patch)
treed19f79bc423a9ab76a31f5ea25f7bd98e893cd66 /mpdnotify/run
parent8a8291bd82935290b69187b92d04842eb0ce1533 (diff)
downloadrunit-services-84f3886d289dccefd965d05b4e17f245d3a309b9.tar.gz
runit-services-84f3886d289dccefd965d05b4e17f245d3a309b9.tar.bz2
runit-services-84f3886d289dccefd965d05b4e17f245d3a309b9.zip
improve mpdnotifys portability
Diffstat (limited to '')
-rwxr-xr-xmpdnotify/run5
1 files changed, 3 insertions, 2 deletions
diff --git a/mpdnotify/run b/mpdnotify/run
index 6f4c929..10ce9e7 100755
--- a/mpdnotify/run
+++ b/mpdnotify/run
@@ -1,6 +1,6 @@
#!/bin/sh
# make sure mpd is running
-sv check "$HOME/.local/share/service/mpd" > /dev/null || exit 1
+sv check "$SV/mpd" > /dev/null || exit 1
# set DISPLAY environment variable so notify send doesn't complain
export DISPLAY=:0
@@ -9,9 +9,10 @@ export DISPLAY=:0
while
song="$(mpc current --wait)"
+ rm -f "$coverartfile" # remove old coverart file
if [ $coverart -eq 1 ]; then
- ffmpeg -y -i "/mnt/hdd/moosic/$(mpc -f %file% | head -1)" "$coverartfile" &
+ ffmpeg -y -i "$musicdir/$(mpc -f %file% | head -1)" "$coverartfile" &
timeout 3 inotifywait -e close "$coverartfile"
notify-send -i "$coverartfile" -r $ID "Now playing" "$song"
else