#!/usr/bin/env dash # nixos-config - My current NixOS configuration # # Copyright (C) 2025 Benedikt Peetz # SPDX-License-Identifier: GPL-3.0-or-later # # This file is part of my nixos-config. # # You should have received a copy of the License along with this program. # If not, see . while true; do state="$(mpc status '%state%')" if [ "$state" = "playing" ]; then song="$(mpc --format '[[%artist% - ]%title%]|[%file%]' current)" progress="$(mpc status "%currenttime%/%totaltime%")" echo "$song :: $progress" else # The song has stopped, we are done displaying it. echo "" # Wait for a new song. (Or in this case for a new event.) mpc idle fi sleep 1 done # vim: ft=sh