2022-02-17 16:08:27 +00:00
|
|
|
#!/usr/bin/bash
|
|
|
|
|
|
|
|
MCLASS=$(playerctl metadata --player=spotify --format '{{lc(status)}}')
|
|
|
|
MICON="🎵"
|
|
|
|
|
|
|
|
if [[ $MCLASS == "playing" ]]; then
|
|
|
|
MINFO=$(playerctl metadata --player=spotify --format '{{artist}} - {{title}}')
|
|
|
|
if [[ ${#MINFO} > 35 ]];
|
|
|
|
then
|
|
|
|
MINFO=$(echo $MINFO | cut -c1-35)"..."
|
|
|
|
fi
|
2022-02-25 14:15:40 +00:00
|
|
|
MTEXT=" "$MICON" "$MINFO" "
|
2022-02-17 16:08:27 +00:00
|
|
|
elif [[ $class == "paused" ]];
|
|
|
|
then
|
|
|
|
MTEXT=$MICON" (paused) "
|
|
|
|
elif [[ $class == "stopped" ]];
|
|
|
|
then
|
|
|
|
MTEXT=""
|
|
|
|
fi
|
|
|
|
|
|
|
|
printf "$MTEXT"
|