feat: simplify player

exit on music stop (no notification)

doesn't call statusbar update
This commit is contained in:
David JULIEN 2021-03-02 20:28:37 +01:00
parent d8b1624160
commit e0eaf5e4b9
1 changed files with 5 additions and 4 deletions

View File

@ -12,11 +12,12 @@
MPC_FORMAT="Artist: <b>%artist%</b> \nTitle: %title% \nAlbum: %album%"
out="$(mpc --format "$MPC_FORMAT" $1 | head -n-1)"
kill -39 $(pidof dwmblocks)
if [ -z "$out" ]; then
out="No music"
exit
else
path="$(mpc --format %file% | head -n1 | awk -F '/' '{ printf "music/%s/%s/cover.png\n", $1,$2 }')"
path="$(mpc --format %file% | head -n1 | awk -F '/' '{ printf "music/%s/%s/cover.jpg\n", $1,$2 }')"
echo $path
dunstify -r 10010 -u "normal" -i "$HOME/$path" "MPD" "$out"
fi
dunstify -r 10010 -u "normal" -i "$HOME/$path" "MPD" "$out"
kill -39 $(pidof dwmblocks)