diff options
| author | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-08-23 12:42:37 +0900 |
|---|---|---|
| committer | TheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com> | 2025-08-23 12:42:37 +0900 |
| commit | 07d294425a98ee5d1e22d03e2b24ae2c76e487c0 (patch) | |
| tree | a6818f0d64438c5fdb88b00a35d944f80c056213 /mac/.config/sketchybar/plugins/music.sh | |
| parent | 6fc28cdb3529ca8ee864cb5c41674cb0a4af72a1 (diff) | |
updates
Diffstat (limited to 'mac/.config/sketchybar/plugins/music.sh')
| -rw-r--r-- | mac/.config/sketchybar/plugins/music.sh | 92 |
1 files changed, 0 insertions, 92 deletions
diff --git a/mac/.config/sketchybar/plugins/music.sh b/mac/.config/sketchybar/plugins/music.sh deleted file mode 100644 index ce23701..0000000 --- a/mac/.config/sketchybar/plugins/music.sh +++ /dev/null @@ -1,92 +0,0 @@ -#!/bin/sh - -# Load global styles, colors and icons -source "$CONFIG_DIR/globalstyles.sh" - -music_item_defaults=( - align=center - width=240 - label.max_chars=33 -) - -music_cover=( - background.image=media.artwork - background.image.scale=5 - background.image.corner_radius=4 - background.image.padding_left=$PADDINGS - background.image.padding_right=$PADDINGS - background.label.align=center - y_offset=-$PADDINGS - align=center -) - -music_artist=( - "${music_item_defaults[@]}" -) - -music_title=( - "${music_item_defaults[@]}" - label.font.style="Bold" -) - -music_album=( - "${music_item_defaults[@]}" -) - -render_bar_item() { - sketchybar --set $NAME label="$CURRENT_ARTIST: $CURRENT_SONG" -} - -render_popup() { - sketchybar --set $NAME.cover "${music_cover[@]}" \ - --set $NAME.artist "${music_artist[@]}" \ - --set $NAME.title "${music_title[@]}" \ - --set $NAME.album "${music_album[@]}" -} - -update() { - CURRENT_ARTIST="$(echo "$INFO" | jq -r '.artist')" - CURRENT_SONG="$(echo "$INFO" | jq -r '.title')" - CURRENT_ALBUM="$(echo "$INFO" | jq -r '.album')" - PLAYER_STATE="$(echo "$INFO" | jq -r '.state')" - - if [ "$PLAYER_STATE" = "playing" ]; then - sketchybar --set $NAME drawing=on \ - icon= \ - --set $NAME.artist label="$CURRENT_ARTIST" \ - --set $NAME.title label="$CURRENT_SONG" \ - --set $NAME.album label="$CURRENT_ALBUM" - render_bar_item - render_popup - - else - sketchybar --set $NAME icon= - popup off - sketchybar --set $NAME drawing=off - fi - -} - -popup() { - sketchybar --set "$NAME" popup.drawing="$1" -} - -playpause() { - osascript -e 'tell application "Music" to playpause' -} - - -case "$SENDER" in -"routine" | "forced" | "media_change") - update - ;; -"mouse.entered") - popup on - ;; -"mouse.exited" | "mouse.exited.global") - popup off - ;; -"mouse.clicked") - playpause - ;; -esac |
