dots/stow/.config/sketchybar/plugins/music.sh
Nico 7bf0f2e8ea
sketchybar: use drawing directly instead of individual options
instead of using background.drawing and label.drawing to change
visiblity, now just use the drawing option instead.
2025-10-05 23:42:28 +11:00

10 lines
406 B
Bash
Executable file

#!/bin/sh
# sketchybar doesn't like it when the line doesn't end with a carriage return
SONG="$(osascript -e 'tell application "Music" to if player state is playing then artist of current track & " - " & name of current track')"
if [[ "$(echo $SONG | wc -w | sed 's/ //g')" != "0" ]]; then
sketchybar --set "$NAME" label="${SONG}" drawing=true
else
sketchybar --set "$NAME" label="" drawing=false
fi