18 lines
546 B
Bash
Executable file
18 lines
546 B
Bash
Executable file
#!/bin/bash
|
|
|
|
formatReturn() {
|
|
targetArtPath="/tmp/.eww.media-art.$(tr -dc 'a-zA-Z0-9' </dev/urandom | head -c 10)"
|
|
|
|
rm /tmp/.eww.media-art.*
|
|
|
|
curl $(playerctl metadata mpris:artUrl) -o "$targetArtPath" >/dev/null
|
|
|
|
playerctl metadata | jq -R -s -c -r --arg artPath "$targetArtPath" 'split("\n") | map(match("(\\w+) {1}([\\w:]+) {3,}(.+)") | {(.captures[1].string): .captures[2].string}) | add | .["mpris:artUrl"] = $artPath'
|
|
|
|
}
|
|
|
|
playerctl --follow metadata | while read line; do
|
|
~/.config/scripts/media.sh display 5
|
|
formatReturn
|
|
|
|
done
|