You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
43 lines
1.3 KiB
43 lines
1.3 KiB
#!/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)
|
|
|
|
## 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
|
|
|
|
# --------------------
|
|
#!/usr/bin/env fish
|
|
|
|
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
|
|
|
|
# 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)
|
|
|
|
# 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
|