sketchybar: only get playing music if Music.app is open
fixes bug where music would keep on starting itself up
This commit is contained in:
parent
3d46bbf25d
commit
ad7c4f42e7
1 changed files with 4 additions and 1 deletions
|
|
@ -1,7 +1,10 @@
|
||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
# sketchybar doesn't like it when the line doesn't end with a carriage return
|
# 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')"
|
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
|
if [[ "$(echo $SONG | wc -w | sed 's/ //g')" != "0" ]]; then
|
||||||
sketchybar --set "$NAME" label="${SONG}" drawing=true
|
sketchybar --set "$NAME" label="${SONG}" drawing=true
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue