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.

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout /  Ubah )

Foto Google+

You are commenting using your Google+ account. Logout /  Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout /  Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout /  Ubah )

Connecting to %s

This site uses Akismet to reduce spam. Learn how your comment data is processed.