#!/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="ArrĂȘt" fi notify-send "MPD" "$infos" # pidof cava && sleep 1 && pkill -USR1 cava done