feat: add album art to notifications

split behaviour for "stop" to avoid shenanigans when looking for the
album art
This commit is contained in:
David JULIEN 2021-02-12 00:11:27 +01:00
parent 6d082216ce
commit ba54cf5032
1 changed files with 10 additions and 2 deletions

View File

@ -9,6 +9,14 @@
# @description : Simple wrapper to mpc, to send notifications
######################################################################
out="$(mpc $1 | head -n2)"
dunstify -r 10010 -u "normal" MPD "$out"
if [ "$1" = "stop" ]; then
mpc $1
dunstify -r 10010 -u "normal" "MPD" "Music stopped"
else
export MPC_FORMAT="Artist: <b>%artist%</b> \nTitle: %title% \nAlbum: %album%"
out="$(mpc $1 | head -n-1)"
path="$(mpc --format %file% | head -n1 | awk -F '/' '{ printf "music/%s/%s/cover.png\n", $1,$2 }')"
dunstify -r 10010 -u "normal" -i "$HOME/$path" "MPD" "$out"
fi