13 lines
435 B
Bash
Executable file
13 lines
435 B
Bash
Executable file
#!/bin/sh
|
|
|
|
# sketchybar doesn't like it when the line doesn't end with a carriage return
|
|
|
|
if pgrep "Music"; then
|
|
SONG="$(osascript -e 'tell application "Music" to if player state is playing then artist of current track & " - " & name of current track')"
|
|
fi
|
|
|
|
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
|