made wallpaper settable with xdg config

This commit is contained in:
Hannes
2026-06-08 23:53:18 +02:00
parent b2eadfe9a2
commit c37db71cac
9 changed files with 97 additions and 12 deletions
+10 -3
View File
@@ -1,10 +1,15 @@
#!/usr/bin/env bash
SCRIPT_DIR="$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)"
# Folder with full-size wallpapers
WALLPAPER_DIR="$HOME/Pictures/Wallpapers"
WALLPAPER_DIR=$("$SCRIPT_DIR/../../scripts/wallpaper_dir.sh")
echo "$WALLPAPER_DIR"
# Folder to store thumbnails
THUMB_DIR="$HOME/.cache/wallpaper-thumbs"
echo "$THUMB_DIR"
if [ ! -d $THUMB_DIR ]; then
mkdir -p $THUMB_DIR;
@@ -66,12 +71,14 @@ for img in "$WALLPAPER_DIR"/*.{jpg,jpeg,png}; do
continue
fi
num+=1
((num++))
# Generate thumbnail using ImageMagick
if [ -x "/usr/bin/magick" ]; then
magick "$img" -resize "${MAX_DIM}x${MAX_DIM}" "$thumb"
rm $temp_image_name
if [ -f "$temp_image_name" ]; then
rm "$temp_image_name"
fi
else
if [ -f "$temp_image_name" ] && [ "$temp_image_name" -nt "$img" ]; then
continue