Teknik Elektro LinksThermostat, Panel Bel, Board Mikro, Driver Relay.

Ultimately Simple Wallpaper Auto-Changer

This post is for beginners. Intermediate users and experts may kindly fill the comments box with an enhanced version of this ultimately simple wallpaper autochanger.

To change desktop wallpaper, we use feh image viewer program. I post 2 version of this ultimately simple wallpaper autochanger. Enjoy and feel free to drop a good comment.

 

wp.sh Script (Version 1)

#! /bin/sh
while true; do
   feh /home/chandra/Pictures/wp/work3.png --bg-center
   sleep 60
   feh /home/chandra/Pictures/wp/work1.jpg --bg-center
   sleep 60
   feh /home/chandra/Pictures/wp/work2.jpg --bg-center
   sleep 60
   feh /home/chandra/Pictures/wp/work4.jpg --bg-center
   sleep 60
   feh /home/chandra/Pictures/wp/work5.jpg --bg-center
   sleep 60
done

The first version of wp.sh simply lists the feh command to view the desktop-wallpaper files within the while-loop. Each feh is followed with sleep command. We can choose our favorite wallpaper images and get them listed there. Use –bg-center or –bg-fill or –bg-scale or –bg-tile to set/adjust the wallpaper image style/fitness.

 

wp.sh Script (Version 2)

#! /bin/sh
WPDIR=/home/chandra/Pictures/wp/
WPDELAY=60
while true; do
   for wp in $(ls $WPDIR); do
      feh $WPDIR$wp --bg-center
      sleep $WPDELAY
   done
done

This version uses for and ls commands to get the lists of image in WPDIR directory. Set WPDELAY for as short/long as you want.

 

Running wp.sh in the Background

To get wp.sh running in the background, invoke wp.sh with ampersand & sign, such as follows

$ sh wp.sh &

 

Screenshots

 

Thank you for reading.

Add a Comment

Your email address will not be published. Required fields are marked *