1
0
Fork 0
dotfiles/.local/bin/statusbar/sb-playerctl

9 lines
457 B
Plaintext
Raw Normal View History

2023-02-06 10:27:26 +01:00
#!/bin/sh
pidof -x sbd-playerctl >/dev/null 2>&1 || sbd-playerctl >/dev/null 2>&1 &
[ "$(playerctl status 2>&1)" = "No players found" ] && echo ""ﱙ && exit 1
# song="$(playerctl metadata xesam:artist) - $(playerctl metadata xesam:title)"
2023-02-09 12:14:40 +01:00
song="$(playerctl metadata xesam:title) - $(playerctl metadata xesam:artist)"
2023-02-06 10:27:26 +01:00
[ ${#song} -gt 35 ] && song="$(printf %.35s "$song")…"
icon=$(playerctl status | sed "s/Playing//;s/Paused//;")
echo "$icon $song"