#!/bin/sh # when a command changes MPD state, print it to file for slstatus to pick up [ $(pgrep -cu "$(whoami)" "$(basename "$0")") -gt 1 ] && exit while : ; do if mpc idle > /dev/null; then #kill -45 "$(pidof "${STATUSBAR:-dwmblocks}")" mpc status > "/tmp/mpd.playing" else break fi done