Page 1 of 1

Gnome3 wallpaper changer

Posted: 09 May 2011, 15:56
by viking60
Here is a perl script that will change your background in Gnome3:

Code: Select all

#!/usr/bin/perl -w
use strict;
use warnings;
my $searchPath = '~/<your_wallpaper_directory>/';   # Set to the directory you want to have searched for photos
my $switchTime = 20;               # Edit to the number of seconds between photo switches
my @photos = `find $searchPath -type f | grep [jJ][pP][eE]*[gG]`;             
chomp(@photos);
my $photo;
while(1)
{
    $photo = $photos[rand($#photos)];
     `gsettings set org.gnome.desktop.background picture-uri "file:///$photo"`;
    sleep($switchTime);
}

Save it as wallpaper.pl and start it with

Code: Select all

perl wallpaper.pl

As you can se it is set to change every 20th second. You can change it as fast as you want by entering the delay in seconds.
To put it in your startup programs:
hit <ALT>+<F2> and enter

Code: Select all

gnome-session-properties

add wp-changer in the GUI and enter this command:

Code: Select all

perl /path/to/script/wallpaper.pl

:A

Re: Gnome3 wallpaper changer

Posted: 10 May 2011, 01:26
by dedanna1029
8-)

Re: Gnome3 wallpaper changer

Posted: 10 May 2011, 01:32
by viking60
:rockon

Re: Gnome3 wallpaper changer

Posted: 04 Jan 2012, 23:02
by viking60
Hey I just noticed: There are big bucks in this +1
Looky here, it costs 3$ in the Apple store.
The ability to ruin your resolution is for free :mrgreen:
(Message to myself: make a fancy website...)

Re: Gnome3 wallpaper changer

Posted: 20 Jan 2012, 19:21
by jemadux
oh thanks viking

Re: Gnome3 wallpaper changer

Posted: 20 Jan 2012, 23:22
by viking60
Your welcome :greetings