New backup 2025-07-18 13:15:02

This commit is contained in:
Penelope Gwen 2025-07-18 13:15:02 -07:00
parent 1c5224b3c7
commit 0ed1ca1ae1
3 changed files with 5 additions and 3 deletions

View file

@ -296,6 +296,7 @@ $home-widget-border-color: rgba($color5,1);
} }
.nowplayingart, .nowplayingart,
.rat { .rat {
background-position: center;
background-size: cover; background-size: cover;
background-repeat: no-repeat; background-repeat: no-repeat;
} }

View file

@ -6,5 +6,6 @@
:orientation "h" :orientation "h"
:width 300 :width 300
:height 300 :height 300
; :style "background-image: url('/run/user/1000/album_art_cache/getCoverArt.view?id=952&u=pogmommy&p=mG%232001068485&v=1.13.0&c=Feishin&size=300');"))
:style "background-image: url('${nowplaying_img_path}');")) :style "background-image: url('${nowplaying_img_path}');"))
; :style "background-image: url('${rat_image}');")) ; :style "background-image: url('${rat_image}');"))

View file

@ -2,7 +2,7 @@
playerctl metadata --format "{{mpris:artUrl}}" --follow | while IFS= read -r line; do playerctl metadata --format "{{mpris:artUrl}}" --follow | while IFS= read -r line; do
if [[ $line == *"http"* ]]; then if [[ $line == *"http"* ]]; then
cache_dir="$XDG_RUNTIME_DIR/album_art_cache" cache_dir="${HOME}/.cache/album_art_cache"
mkdir -p "$cache_dir" mkdir -p "$cache_dir"
file_name=$(basename "$line") file_name=$(basename "$line")
file_path="$cache_dir/$file_name" file_path="$cache_dir/$file_name"
@ -10,10 +10,10 @@ playerctl metadata --format "{{mpris:artUrl}}" --follow | while IFS= read -r lin
# Check if file exists # Check if file exists
if [ -e "$file_path" ]; then if [ -e "$file_path" ]; then
# File exists, return path immediately # File exists, return path immediately
echo "file://$file_path" echo "$file_path"
else else
curl --output "$file_path" "$line" > /dev/null 2>&1 curl --output "$file_path" "$line" > /dev/null 2>&1
echo "file://$file_path" echo "$file_path"
fi fi
else else
# artUrl doesn't have a link, nothing to do # artUrl doesn't have a link, nothing to do