aboutsummaryrefslogtreecommitdiffstats
path: root/scripts/mprish.sh
blob: 54b78cac7ab7dc20eb6f20d7a88cc29ada0ec50d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
#!/bin/bash

# Specifying the icon(s) in the script
# This allows us to change its appearance conditionally

player_status=$(playerctl status 2> /dev/null)
if [[ $player_status == "Playing" || $player_status == "Paused" ]]; then
    metadata="$(playerctl metadata artist) - $(playerctl metadata title)"
fi

# Foreground color formatting tags are optional
if [[ $player_status == "Playing" ]]; then
    # Orange when playing
    echo "$metadata"
elif [[ $player_status == "Paused" ]]; then
    # Greyed out info when paused
    echo "$metadata"
else
    # Greyed out icon when stopped
    echo ""
fi