Created
December 17, 2013 07:33
-
-
Save rohithreddy/8001369 to your computer and use it in GitHub Desktop.
Bash Script to Change Wallpaper
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
WALLPAPERS="/path/to/wallpapers/directory" | |
ALIST=( `/bin/ls -w1 $WALLPAPERS` ) | |
RANGE=${#ALIST[@]} | |
let "number = $RANDOM" | |
let LASTNUM="`/bin/cat $WALLPAPERS/.last` + $number" | |
let "number = $LASTNUM % $RANGE" | |
echo $number > $WALLPAPERS/.last | |
feh --bg-center $WALLPAPERS/${ALIST[$number]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment