dotfiles/.local/bin/mpd-notif

18 lines
458 B
Bash
Executable file

#!/bin/bash
export MPD_HOST="$HOME/.mpd/socket"
while true
do
systemctl --user is-active mpd.service || exit 1
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
if [[ -z "$infos" ]]
then
infos="<i>Arrêt</i>"
fi
notify-send "MPD" "$infos"
pidof cava && pkill -USR1 cava
done