summaryrefslogtreecommitdiff
path: root/.config/polybar/music
blob: a7a9e947f2399e9470a86b91edcaa65e7835334c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

player_status=$(playerctl status 2> /dev/null)
if [[ $? -eq 0 ]]; then
    metadata=$(echo "$(playerctl metadata title) - $(playerctl metadata artist) - $(playerctl metadata album)" | cut -c -80)
fi

# Foreground color formatting tags are optional
if [[ $player_status = "Playing" ]]; then
    echo "%{F#FFFFFF}⏯️ $metadata%{F-}"
elif [[ $player_status = "Paused" ]]; then
    echo "%{F#999}⏸️ $metadata%{F-}"
else
    echo ""
fi