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