When I reformatted and installed Fedora 17 Linux, I needed a way to randomly change my background wallpaper. After about 30 minutes of google’ing, I could not locate any simple fedora 17 packages or pre-made extensions for GNOME 3. With the help from pender and kolo from this forum post I was able to get a stable script running. Below you can find the script and how to implement it into a working GNOME 3 desktop.
Random Background Wallpaper Change Script
my $searchPath = '/adan/+MEDIA+/+IMAGES+/Wallpapers/+WALLPAPERS-1920x1080+/'; # Set to the directory you want to have searched for photos
my $switchTime = 3600; # Edit to the number of seconds between photo switches
my @photos = `find $searchPath -type f | grep [jJ][pP][eE]*[gG]`;
$photo = $photos[rand($#photos)];
`gsettings set org.gnome.desktop.background picture-uri "file:///$photo"`;
Create a new file ‘background-changer‘ and copy + paste the above code into it.
Edit the 5th and 6th line to the configure the script.
Then you need to save it and make sure you ‘chmod +x background-changer‘ to make sure its executable.
To auto run this script when you login, just add a new ‘Startup Application‘
yum -y install gnome-session-properties
NAME: Background Changer
COMMAND: /home/djravine/Scripts/Background-Changer/background-changer (Location of the script)
COMMENT: A new random background every hour.
Now try a reboot and you should see a new random wallpaper every time.