11 lines
600 B
Bash
Executable file
11 lines
600 B
Bash
Executable file
#!/bin/sh
|
|
. "$HOME/.local/libexec/statusbar/colors"
|
|
|
|
pidof -x sbd-playerctl >/dev/null 2>&1 || "$HOME/.local/libexec/daemons/sbd-playerctl" >/dev/null 2>&1 &
|
|
[ "$(playerctl status 2>&1)" = "No players found" ] && printf "%b" "<span $big></span>" && exit 1
|
|
# song="$(playerctl metadata xesam:artist) - $(playerctl metadata xesam:title)"
|
|
song="$(playerctl metadata xesam:title) - $(playerctl metadata xesam:artist)"
|
|
[ ${#song} -gt 35 ] && song="$(printf %.35s "$song")…"
|
|
|
|
icon="$(playerctl status | sed "s/Playing//;s/Paused//;s/Stopped//;")"
|
|
printf "%b" "<span $big>$icon</span> $song"
|