Skip to content

Instantly share code, notes, and snippets.

@gjabell
gjabell / music
Created April 3, 2017 00:46
Polybar (with music)
#!/bin/bash
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#FFFFFF}$metadata%{F-}"