Posted: Thu Oct 18, 2018 2:08 pm
I wish to use the folder "pictures" as my screensaver and set the time for each picture to change every 5 - 7 seconds. How do I do this, please?
Welcome to the Linux Mint forums! For help, knowledge, and fellowship.
inxi -Fxzin between
apt install cinnamon-screensaver-*should pull them in.
imageDirectory: /home/<user>/Pictures/if you need to. This file is created when you pick a xscreensaver option in the Screensaver module.
~/bin/lock_screen_photo_slide_show.sh, make executable. Add a startup command using the Startup Applications to launch it after log-on - give it a delay of about 30 seconds. It will change the lock-screen background to a random .jpg from your pictures folder every 5 seconds - it searches recursively through all sub folders in
Code: Select all
!/bin/bash # Script to set a lock screen slideshow for cinnamon's default lockscreen screensaver # Check for existing instance and exit for PID in $(pgrep -f "lock_screen_photo_slide_show.sh"); do if [ "$PID" != $$ ]; then exit 1 fi done # Background file definitions DIR="$HOME/Pictures/" DELAY=5 DESK_BACKGROUND=$(gsettings get org.cinnamon.desktop.background picture-uri) # Start the main loop to monitor screensaver status while : do ACTIVE=false #Screensaver active loop while cinnamon-screensaver-command -q | grep -q "The screensaver is active" do if ( ! $ACTIVE ) ; then DESK_BACKGROUND=$(gsettings get org.cinnamon.desktop.background picture-uri) ACTIVE=true TIMER="$DELAY" fi if [ $TIMER == $DELAY ] ; then LOCK_BACKGROUND=$(find "$DIR" -iname '*.jp*g' | shuf -n1) gsettings set org.cinnamon.desktop.background picture-uri "file://$LOCK_BACKGROUND" TIMER=0 fi ((TIMER++)) sleep 1 done #Screensaver inactive loop while cinnamon-screensaver-command -q | grep -q "The screensaver is inactive" do if ( $ACTIVE ) ; then gsettings set org.cinnamon.desktop.background picture-uri "$DESK_BACKGROUND" ACTIVE=false fi sleep 1 done done