dotfiles/.local/bin/mpd-notif

18 lines
458 B
Plaintext
Raw Normal View History

2019-06-13 20:12:29 +02:00
#!/bin/bash
export MPD_HOST="$HOME/.mpd/socket"
while true
do
systemctl --user is-active mpd.service || exit 1
2019-06-14 09:42:47 +02:00
infos=$(mpc -w -f '[[%artist%\n]%title%[\n%album%]]|[%file%]' current)
mpc -f '[[%artist%§]%title%|[%file%]' current > /dev/shm/mpd
echo "$(</dev/shm/mpd) " > /dev/shm/mpd-scroll
2019-06-13 20:12:29 +02:00
if [[ -z "$infos" ]]
then
infos="<i>Arrêt</i>"
fi
notify-send "MPD" "$infos"
2019-07-19 23:11:53 +02:00
pidof cava && pkill -USR1 cava
2019-06-13 20:12:29 +02:00
done