You are not logged in.

#1 2010-04-16 23:05:58

Popeye
Member
Registered: 2010-04-16
Posts: 2

Wallpaper Changer

Hey all,

I wrote a small script designed to change my desktop background image in gnome every half-hour. 

find "/path/to/wallpapers" -type f  | while read wallpaper_path
do

        gconftool-2 --type string --set /desktop/gnome/background/picture_filename "${wallpaper_path}"
        sleep 1800

done

I haven't needed to yet because I have  a pretty large number of pictures in that file, but eventually I think I will put a loop in to keep it running continuously and add the script to my startup. 

I was wondering if this is really the best way to perform this task.  It works, but I'm guessing that this pausing/infinite-loop design would be inefficent and would take up system resources (although I have not noticed any large impact while running it so far).  Is there a better way to do this?  I noticed this thread: http://bbs.archlinux.org/viewtopic.php?id=54659.  Is using cron a better solution? 

Thanks

Offline

#2 2010-04-17 00:16:09

Berticus
Member
Registered: 2008-06-11
Posts: 731

Re: Wallpaper Changer

ever hear of cron jobs? Just write the switcher and have a cron job take care of the scheduling.

Offline

#3 2010-04-17 02:06:40

cesura
Package Maintainer (PM)
From: Tallinn, Estonia
Registered: 2010-01-23
Posts: 1,867

Re: Wallpaper Changer

This should be moved to "General Programming Forum".

Anyway, a cron job is the way to go. Maybe put the script in one of the folders in /etc (cron.hourly, cron.daily, etc)

Offline

#4 2010-04-17 04:02:42

Popeye
Member
Registered: 2010-04-16
Posts: 2

Re: Wallpaper Changer

That is sort of what I thought.  Thanks for confirming my suspicion.  I'll try to rework it using cron and post what I have done for others.

Offline

Board footer

Powered by FluxBB