dotfiles/.local/bin/mpd-notif

18 lines
420 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% - ]%title%[\n%album%]]|[%file%]' current)
mpc -f '[[%artist%, ]%title%|[%file%]' current > /dev/shm/mpd
cp /dev/shm/mpd /dev/shm/mpd-scroll
if [[ -z "$infos" ]]
then
infos="<i>Arrêt</i>"
fi
notify-send "MPD" "$infos"
# pidof cava && sleep 1 && pkill -USR1 cava
done