lmariscal icon

mpris.sh

lmariscal | PRO | 04/08/17 05:21:23 AM UTC | 0 ⭐ | 583 👁️ | Never ⏰ | []
Bash |

630 B

|

None

|

0 👍

/

0 👎

#!/bin/bash
 
# Specifying the icon(s) in the script
# This allows us to change its appearance conditionally
icon=""
 
player_status=$(playerctl status 2> /dev/null)
if [[ $? -eq 0 ]]; then
    metadata="$(playerctl metadata artist) - $(playerctl metadata title)"
fi
 
# Foreground color formatting tags are optional
if [[ $player_status = "Playing" ]]; then
    echo "%{F#bfaaff77}$icon $metadata"       # Orange when playing
elif [[ $player_status = "Paused" ]]; then
    echo "%{F#65737E}$icon $metadata"       # Greyed out info when paused
else
    echo "%{F#65737E}$icon"                 # Greyed out icon when stopped
fi

Comments