Here's a script I just put together to automatically change the wallpaper in Gnome Shell. I think it will also work in Ubuntu if Unity uses gsettings for the wallpaper (which I think it does?). Someone's probably done this before, but here it is. You run it as:
Code:
./wallpaper_switcher.sh $time
where $time is the amount of time to wait in minutes before switching the wallpaper. In the script, you will also need to change $dir to the directory with the pictures you want to use as a wallpaper. You can set up this script to run on startup, of course. The script will select a picture at random every $time minutes from the available files in the directory you specified.
I figured this thread was as good as any to post this, but let me know if there's a better place.
Code:
#!/bin/bash
# Wait time specified in minutes
time=$1
dir=/home/dprosser/Pictures
# Get list of pictures and number of pictures
npic=1
while read line; do
pic[$npic]="$line"
npic=`expr $npic + 1`
done < <(ls $dir)
npic=`expr $npic - 1`
# Change picture every however often is requested
I=1
while [ $I -lt 2 ]; do
# Select a random picture from the list
number=$[ ( $RANDOM % $npic ) + 1 ]
# Change the wallpaper
gsettings set org.gnome.desktop.background picture-uri file://${dir}/${pic[$number]}
# Wait awhile
sleep ${1}m
done
Bookmarks