blob: 6767275b72b4014e08e81ea9da6e2020c6674089 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
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"
|