mirror of
https://github.com/danbulant/dotfiles
synced 2026-05-24 12:35:34 +00:00
19 lines
426 B
Bash
19 lines
426 B
Bash
#!/bin/bash
|
|
album_art=$(playerctl -p spotify metadata mpris:artUrl)
|
|
if [[ -z $album_art ]]
|
|
then
|
|
# spotify is dead, we should die too.
|
|
exit
|
|
fi
|
|
if [[ -f /tmp/cover.url ]]
|
|
then
|
|
old_album_art=$(cat /tmp/cover.url)
|
|
if [[ $old_album_art == $album_art ]]
|
|
then
|
|
echo "/tmp/cover.jpeg"
|
|
exit
|
|
fi
|
|
fi
|
|
curl -s "${album_art}" --output "/tmp/cover.jpeg"
|
|
echo ${album_art} > /tmp/cover.url
|
|
echo "/tmp/cover.jpeg"
|