nixos-config/scripts/playerctl-status

15 lines
299 B
Plaintext
Raw Normal View History

2023-02-08 17:12:54 -03:00
#!/bin/sh
PLAYERCTL="playerctl --ignore-player=mpd"
STATUS="$(env LC_ALL=C $PLAYERCTL status title)"
TITLE="$($PLAYERCTL metadata title)"
ARTIST="$($PLAYERCTL metadata artist)"
test "$STATUS" = "Playing" \
&& printf " %s" "$TITLE" \
&& test -n "$ARTIST" \
&& printf " - %s" "$ARTIST"
echo ""