Browse Source

Keep images vertical

slideshow-screensaver
Kevin Mok 7 days ago
parent
commit
784ba569c3
Signed by: Kevin-Mok GPG Key ID: FB0DA56BEB5D98F3
  1. 33
      scripts/executable_dual-monitor-slideshow

33
scripts/executable_dual-monitor-slideshow

@ -47,7 +47,7 @@
# Configuration
set WALLPAPER_DIR "/mnt/linux-files-2/Pictures/hevin"
set CYCLE_TIME 5 # Seconds between image changes
set CYCLE_TIME 2 # Seconds between image changes
#set BLUR_AMOUNT "0x5" # Set to "0x0" for no blur
set BLUR_AMOUNT "0x0" # Set to "0x0" for no blur
@ -85,12 +85,31 @@ while true
set image (fdfind -e jpg -e jpeg -e png -e webp . $WALLPAPER_DIR | shuf -n 1)
if test -n "$image"
echo "Found image: $image"
convert "$image" \
-resize {$width}x{$height}^ \
-gravity center \
-extent {$width}x{$height} \
-blur $BLUR_AMOUNT \
"/tmp/screensaver-$monitor.png"
# Get image dimensions
set img_info (identify -format "%wx%h" "$image")
set img_width (echo $img_info | cut -d'x' -f1)
set img_height (echo $img_info | cut -d'x' -f2)
# Process image based on orientation
if test $img_height -gt $img_width
# Vertical image - fit to height with black background
convert "$image" \
-resize x{$height}^ \
-gravity center \
-background black \
-extent {$width}x{$height} \
-blur $BLUR_AMOUNT \
"/tmp/screensaver-$monitor.png"
else
# Horizontal image - fit to width
convert "$image" \
-resize {$width}x^ \
-gravity center \
-extent {$width}x{$height} \
-blur $BLUR_AMOUNT \
"/tmp/screensaver-$monitor.png"
end
# Display image on single monitor
feh --no-fehbg --hide-pointer --fullscreen --title 'screensaver' "/tmp/screensaver-$monitor.png" &

Loading…
Cancel
Save