This repository has been archived on 2024-04-14. You can view files and clone it, but cannot push or open issues or pull requests.
nixos-dotfiles/user/configs/wayland/hyprland/eww/config/scripts/mpd_current_song.sh

20 lines
387 B
Bash
Executable File

#!/usr/bin/env cached-nix-shell
#!nix-shell -i bash -p mpc-cli
currentsong=""
state=""
while true; do
state=$(mpc status %state%)
current_song=$(mpc current)
if [[ $state == "playing" ]]; then
echo "$current_song"
elif [[ $state == "paused" && $current_song ]]; then
echo "󰏤 $current_song"
else
echo " stopped"
fi
mpc idle player &> /dev/null
done