Files
whyfile---Niri-Dots/config/hypr out of date/scripts/art.sh
2025-08-26 13:21:07 +03:00

20 lines
575 B
Bash
Executable File

#!/usr/bin/bash
url=$(playerctl metadata mpris:artUrl)
artist=$(playerctl metadata xesam:artist)
title=$(playerctl metadata xesam:title)
metadata=$(printf "$artist - $title")
if [ $url == "No player found" ]
then
exit
elif [ -f /home/tdm/.cache/albumart/"$metadata".png ]
then
echo /home/tdm/.cache/albumart/"$metadata".png
else
curl -s $url -o /home/tdm/.cache/albumart/"$metadata"
magick /home/tdm/.cache/albumart/"$metadata" /home/tdm/.cache/albumart/"$metadata".png
rm /home/tdm/.cache/albumart/"$metadata"
echo /home/tdm/.cache/albumart/"$metadata".png
fi