summaryrefslogtreecommitdiff
path: root/mac/.config/sketchybar/plugins
diff options
context:
space:
mode:
authorTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-08-29 16:19:18 +0900
committerTheSiahxyz <164138827+TheSiahxyz@users.noreply.github.com>2025-08-29 16:19:18 +0900
commit2f443bae9cbf11c8e2e3183c50c4b7cd21096605 (patch)
tree0f33aa273b134339966b6db99b4d1c63116d9673 /mac/.config/sketchybar/plugins
parent4007d650b739de47e6010daa90a5c74ece1e27aa (diff)
modified sketchybar/sketchybarrc, created plugins/youtube-music.sh
Diffstat (limited to 'mac/.config/sketchybar/plugins')
-rwxr-xr-xmac/.config/sketchybar/plugins/youtube-music.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/mac/.config/sketchybar/plugins/youtube-music.sh b/mac/.config/sketchybar/plugins/youtube-music.sh
new file mode 100755
index 0000000..6767275
--- /dev/null
+++ b/mac/.config/sketchybar/plugins/youtube-music.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+
+SONG_INFO=$(curl -s 0.0.0.0:26538/api/v1/song-info)
+
+PAUSED="$(echo "$SONG_INFO" | jq -r '.isPaused')"
+CURRENT_SONG="$(echo "$SONG_INFO" | jq -r '.title + " - " + .artist')"
+ARTWORK="$(echo "$SONG_INFO" | jq -r '.imageSrc')"
+ARTWORK_LOCATION="$(curl -O --output-dir "$TMPDIR" -s --remote-name -w "%{filename_effective}" "$ARTWORK")"
+
+if [ "$PAUSED" = true ]; then
+ ICON=􀊄
+else
+ ICON=􁁒
+fi
+sketchybar --set "$NAME" label="$CURRENT_SONG" icon="$ICON" drawing=on
+sketchybar --set "$NAME"-artwork background.image="$ARTWORK_LOCATION"