Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I heard this is a new feature in 9.10, but I can't figure out how to use it. If it isn't a default feature, what's the best way to go about setting it up?

I prefer to have something invisible--no panel applets, unless the panel icon can be turned off.

share|improve this question

3 Answers 3

up vote 3 down vote accepted

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.

share|improve this answer
    
Does the script actually run without errors? you'll have to update me. –  John T Dec 21 '09 at 18:59
    
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 Dec 21 '09 at 19:20
    
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 Dec 21 '09 at 19:22
1  
Thanks 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 Dec 21 '09 at 19:34
1  
As 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 Dec 21 '09 at 19:37

Here's a quick shell script and cron job that will change to a random wallpaper every hour.

/home/aolsen/bin/wallpaper.sh

BKG_DIR="/home/aolsen/BKG/"
FILE="${BKG_DIR}$(ls "${BKG_DIR}" |sort -R |head -n1)" 
gconftool-2 --type string --set /desktop/gnome/background/picture_filename "${FILE}"

crontab -e

0 * * * * /home/aolsen/bin/wallpaper.sh

Change the 0 to */5 to make it switch every 5 minutes.

share|improve this answer

From here

Configure Desktop gives the option of a slideshow composed of any backgrounds you choose.

.

you can user wallpaper-tray is nice and easy. The options are very similar to kde's desktop background options.

share|improve this answer
    
I'm not sure what "Configure Desktop" is. It's not in a default Ubuntu 9.10 intall, and it's not in the repositories. wallpaper-tray and the similar "Desktop Drapes" are panel applets, I'd rather have something invisible (I'll edit my question to reflect this). –  Matthew Nov 12 '09 at 16:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.