improve structure; move stuff to relevant folders

This commit is contained in:
2025-12-31 14:53:07 +02:00
parent e4296a3251
commit e405894cc2
34 changed files with 1452 additions and 80 deletions
@@ -0,0 +1,32 @@
#!/bin/bash
# Find a random image file
#IMAGE=$(find /run/media/raga/970/qBittorrent/nsfw/xd -type f \( -name '*.png' -o -name '*.jpg' -o -name '*.jpeg' \) | shuf -n 1)
IMAGE=$(find /run/media/raga/970/images/cars/wallpaper -type f \( -name '*.png' -o -name '*.jpg' -o -name '*.jpeg' \) | shuf -n 1)
if [ -n "$IMAGE" ]; then
echo "Image: $IMAGE"
# Try to get image dimensions using identify (ImageMagick)
DIMENSIONS=$(identify -format "%wx%h" "$IMAGE" 2>/dev/null)
if [ -n "$DIMENSIONS" ]; then
echo "Dimensions: $DIMENSIONS"
WIDTH=$(echo "$DIMENSIONS" | cut -d'x' -f1)
HEIGHT=$(echo "$DIMENSIONS" | cut -d'x' -f2)
# Determine if portrait (height > width) or landscape
if [ "$HEIGHT" -gt "$WIDTH" ]; then
# Portrait image - use "fit" to maintain aspect ratio
echo "Portrait image - using fit"
swaymsg "output * bg \"$IMAGE\" fit"
else
# Landscape image - use "fill" to fill the screen
echo "Landscape image - using fill"
swaymsg "output * bg \"$IMAGE\" fill"
fi
else
# Fallback to fill if we can't determine dimensions
echo "Could not determine dimensions - using fill"
swaymsg "output * bg \"$IMAGE\" fill"
fi
fi