#!/bin/sh # This loop will update the music statusbar module whenever a command changes the # music player's status. mpd and must be running on X's start for this to work. { playerctl metadata -F -f "{{title}}{{artist}}{{status}}" & while ! mpc idleloop 2>/dev/null; do sleep 1 done } | while read -r _; do pkill -RTMIN+2 "$STATUSBAR" done