dotfiles/.config/polybar/player-status.sh

17 lines
424 B
Bash
Raw Normal View History

2024-02-26 13:15:20 +01:00
#!/bin/sh
status="$(playerctl -p spotify status 2>&1)"
if [ "$status" != "No players found" ]
then
artist="$(playerctl -p spotify metadata artist)"
if [ "$artist" != "" ]
then
echo "$(playerctl -p spotify metadata artist) - $(playerctl -p spotify metadata title)"
else
# Clear any string that was previously displayed
echo ""
fi
else
# Clear any string that was previously displayed
echo ""
fi