You can do this without installing additional software. Simply use gconftool
with a little shell script trickery (untested):
#!/bin/bash
while [ 1 ]
do
find /path/to/wallpapers/folder -type f > ~/walls.txt
count=$(cat ~/walls.txt | wc -l)
for files in $(seq $count)
do
file=$(cat ~/walls.txt | head -n $files | tail -n 1)
gconftool-2 --type string --set /desktop/gnome/background/picture_filename "$file"
sleep 300 # wait 5 minutes before changing again
done
done
you'll need to change the /path/to/wallpaper/folder
accordingly. This will go through every image in the folder, changing every 5 minutes. Once they've all been used it will start at the beginning again, and regenerate the file containing the names of the wallpapers to include any new wallpapers.
Does the script actually run without errors? you'll have to update me. – John T – 2009-12-21T18:59:57.683
Yep, thanks! Obviously I had to change the path, but other than that...one important note: you must run this script as yourself. Don't do sudo or anything, or it won't change the background (I think it changes the super user's background instead).
Is there any way to do this without creating a new file? It works fine, it just seems kind of messy to do it this way. – Matthew – 2009-12-21T19:20:22.603
Also, you might want to tweak the script to start on your current background, instead of restarting the cycle every time the script is run. I might play around with this later today and try to improve it. – Matthew – 2009-12-21T19:22:08.420
1Thanks for the clarification, that's pretty awesome. You can use a different method other than flat files, but that would involve another query on the directory, and I tried to stick with the UNIX tradition of using flat files for mostly everything. Depending on how many images there are it could make a noticeable "hiccup" in your activities, as simple I/O on a flat file wouldn't be as noticeable. For that reason I only did it once after every wallpaper has cycled. gconftool will change the current users settings like you said, thats why running as sudo will not work. – John T – 2009-12-21T19:34:50.623
1As for starting on the current background, after the file is created you could use
cat -n
to prepend line numbers, then grep the current value from gconftool, and yank the line number from the beginning then start from there. Multiple ways to skin a cat, keep me updated on your improvements, If I have time I may code a daemon to do this. – John T – 2009-12-21T19:37:16.343