1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
#!/usr/bin/env bash tput civis cleanup() { tput cnorm } trap cleanup EXIT while true; do now-playing mpc status "%currenttime% / %totaltime%" echo mpc status -f '' | sed -n 3p # mpc idle >/dev/null sleep 0.3s done