backgrond

GNOME Rotate Background Script

Just wrote a little script that rotates my background ever once in a while - as to not get bored!

Save as rotate.sh and make executable

#!/bin/bash

#
# Rotates GNOME Wallpaper using pictures in $FOLDER
# Run in background: ./rotate.sh &
# Make sure there are no spaces in picture filenames
# http://ubuntu.online02.com/node/37
#

FOLDER="/home/phillip/Graphics/Wallpapers/current" # Change to your directory
cd $FOLDER

loop () {
NUMBER=$(ls -1 | wc -l)
RAN=$(($RANDOM%$NUMBER+1))
FILE=$(ls -1 | sed -n ${RAN}p)
echo $FILE
gconftool-2 --set "/desktop/gnome/background/picture_filename" --type string "$FOLDER/$FILE"
sleep 55 # Time between change
loop
}
loop

Syndicate content