Browse Source
feh slideshow on one monitor
feh slideshow on one monitor
1 changed files with 33 additions and 31 deletions
@ -1,41 +1,43 @@ |
|||
#!/usr/bin/env fish |
|||
|
|||
# Find a random image |
|||
set image (fdfind -e jpg -e jpeg -e png -e webp . /mnt/linux-files-2/Pictures/hevin | shuf -n 1) |
|||
#set image (fdfind -e jpg -e jpeg -e png -e webp . /mnt/linux-files-2/Pictures/hevin | shuf -n 1) |
|||
|
|||
# Create blurred lock image |
|||
convert "$image" -resize 1920x1080^ -gravity center -extent 1920x1080 /tmp/lock.png |
|||
## Create blurred lock image |
|||
#convert "$image" -resize 1920x1080^ -gravity center -extent 1920x1080 /tmp/lock.png |
|||
|
|||
# Lock with i3lock-color |
|||
i3lock -n -i /tmp/lock.png |
|||
## Lock with i3lock-color |
|||
#i3lock -n -i /tmp/lock.png |
|||
|
|||
# -------------------- |
|||
#!/usr/bin/env fish |
|||
|
|||
# Directory containing your wallpapers |
|||
#set WALLPAPER_DIR ~/Pictures/Screensaver |
|||
set WALLPAPER_DIR "/mnt/linux-files-2/Pictures/hevin" |
|||
set CYCLE_TIME 5 # Seconds between image changes |
|||
set LOCK_AFTER 500 # Activate real lock after 30 seconds of screensaver |
|||
|
|||
## Get a list of monitors |
|||
#set MONITORS (xrandr --listmonitors | grep -v 'Monitors:' | awk '{print $4}') |
|||
|
|||
## Generate blurred lock images for each monitor |
|||
#for monitor in $MONITORS |
|||
## Pick a random image for this monitor |
|||
#set IMAGE (fdfind -e jpg -e jpeg -e png -e webp . $WALLPAPER_DIR | shuf -n 1) |
|||
# Use a transparent window to cover everything |
|||
while true |
|||
set image (fdfind -e jpg -e jpeg -e png -e webp . $WALLPAPER_DIR | shuf -n 1) |
|||
|
|||
## Generate a blurred version at /tmp/lock-$monitor.png |
|||
#convert "$IMAGE" \ |
|||
#-resize 1920x1080^ \ |
|||
#-gravity center \ |
|||
#-extent 1920x1080 \ |
|||
#-blur 0x8 \ |
|||
#"/tmp/lock-$monitor.png" |
|||
#end |
|||
|
|||
## Build i3lock command for each monitor |
|||
#set LOCK_CMD "i3lock-color -n" |
|||
#for monitor in $MONITORS |
|||
#set LOCK_CMD "$LOCK_CMD --image=/tmp/lock-$monitor.png --screen=$monitor --ignore-empty-password" |
|||
#end |
|||
|
|||
## Execute the lock command |
|||
#eval $LOCK_CMD |
|||
# Create fullscreen image |
|||
convert "$image" -resize (xrandr | grep '*' | head -1 | awk '{print $1}')^ \ |
|||
-gravity center -extent (xrandr | grep '*' | head -1 | awk '{print $1}') \ |
|||
/tmp/screensaver.png |
|||
|
|||
# Display fullscreen using feh |
|||
feh --fullscreen --hide-pointer --no-fehbg /tmp/screensaver.png & |
|||
set feh_pid $last_pid |
|||
|
|||
# Wait for timeout or mouse movement |
|||
sleep $CYCLE_TIME |
|||
kill $feh_pid |
|||
|
|||
# After longer timeout, activate real lock |
|||
if test (math $CYCLE_TIME \* $count) -ge $LOCK_AFTER |
|||
i3lock -n -i /tmp/screensaver.png |
|||
set count 0 |
|||
else |
|||
set count (math $count + 1) |
|||
end |
|||
end |
Write
Preview
Loading…
Cancel
Save
Reference in new issue