#!/bin/sh # make sure mpd is running sv check "$SV/mpd" > /dev/null || exit 1 # set DISPLAY environment variable so notify send doesn't complain export DISPLAY=:0 [ -f ./conf ] && . ./conf || exit 1 while song="$(mpc current --wait)" rm -f "$coverartfile" # remove old coverart file if [ $coverart -eq 1 ]; then ffmpeg -y -i "$musicdir/$(mpc -f %file% | head -1)" "$coverartfile" &&\ notify-send -i "$coverartfile" -r $ID "Now playing" "$song" else notify-send -r $ID "Now playing" "$song" fi do :; done