dotfiles/.local/bin/mpd-notif

18 lines
470 B
Text
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"
# pidof cava && sleep 1 && pkill -USR1 cava
done