Added Thumbnailing to wallpaper picker

This commit is contained in:
Hannes
2026-02-12 21:09:56 +01:00
parent 19f74f2865
commit 5d2784ecb4
4 changed files with 98 additions and 14 deletions
+32 -11
View File
@@ -2,6 +2,10 @@
# Path to the image is the first argument
IMAGE="$1"
image_name=$(basename "$IMAGE")
image="$HOME/Pictures/Wallpapers/$image_name"
echo "$image"
echo "start"
@@ -11,17 +15,34 @@ if [[ -z "$IMAGE" ]]; then
exit 1
fi
# Check if swww daemon is running
if ! pgrep -x "swww-daemon" > /dev/null; then
echo "Starting swww daemon..."
swww-daemon &
# Give the daemon a moment to start
sleep 0.2
echo "daemon started"
fi
if [ -x "/usr/bin/swww-daemon" ]; then
echo "swww-daemon exists and is executable"
# Set the wallpaper
echo "running"
swww img "$IMAGE" -t grow --transition-duration 1
# Check if swww daemon is running
if ! pgrep -x "swww-daemon" > /dev/null; then
echo "Starting swww daemon..."
swww-daemon &
# Give the daemon a moment to start
sleep 0.2
echo "daemon started"
fi
# Set the wallpaper
echo "running"
swww img "$image" -t grow --transition-duration 1
elif [ -x "/usr/bin/hyprpaper" ]; then
echo "hyprpaper exists and is executable"
if ! pgrep -x "hyprpaper" > /dev/null; then
echo "Starting hyprpaper daemon..."
hyprpaper &
# Give the daemon a moment to start
sleep 0.2
echo "daemon started"
fi
hyprctl hyprpaper wallpaper ", $image"
fi