fix(sketchybar): music plugin - fall back to artist name
This commit is contained in:
parent
06f3d3f64d
commit
ef66995337
1 changed files with 5 additions and 0 deletions
|
@ -5,6 +5,11 @@ if pgrep -xq Music; then
|
||||||
TRACK=$(osascript -e 'tell application "Music" to name of current track as string' 2>/dev/null || echo "")
|
TRACK=$(osascript -e 'tell application "Music" to name of current track as string' 2>/dev/null || echo "")
|
||||||
ARTIST=$(osascript -e 'tell application "Music" to album artist of current track as string' 2>/dev/null || echo "")
|
ARTIST=$(osascript -e 'tell application "Music" to album artist of current track as string' 2>/dev/null || echo "")
|
||||||
|
|
||||||
|
# fall back to artist, if album artist is unavailable, or generic
|
||||||
|
if [ "$ARTIST" = "" ] || [ "$ARTIST" = "Various Artists" ]; then
|
||||||
|
ARTIST=$(osascript -e 'tell application "Music" to artist of current track as string' 2>/dev/null || echo "")
|
||||||
|
fi
|
||||||
|
|
||||||
if [ "$STATE" = "playing" ]; then
|
if [ "$STATE" = "playing" ]; then
|
||||||
ICON=""
|
ICON=""
|
||||||
LABEL="$ARTIST - $TRACK"
|
LABEL="$ARTIST - $TRACK"
|
||||||
|
|
Loading…
Reference in a new issue