Gnome3 wallpaper changer

Every day solutions to every day challenges. + Brilliant stuff

Moderators: b1o, jkerr82508

Forum rules
Please feel free to post your tip it does not have to be advanced. Also ask questions directly related to the tip here. But do not start new threads with questions or ask for help here. That is what the help section is for. forum rules: http://bjoernvold.com/forum/viewtopic.php?f=8&t=568
User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Gnome3 wallpaper changer

Postby viking60 » 09 May 2011, 15:56

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
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
dedanna1029
Sound-Berserk
Posts: 8780
Joined: 14 Mar 2010, 20:29
Contact:

Re: Gnome3 wallpaper changer

Postby dedanna1029 » 10 May 2011, 01:26

8-)
I'd rather be a free person who fears terrorists, than be a "safe" person who fears the government.
No gods, no masters.
"A druid is by nature anarchistic, that is, submits to no one."
http://uk.druidcollege.org/faqs.html

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Gnome3 wallpaper changer

Postby viking60 » 10 May 2011, 01:32

:rockon
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Gnome3 wallpaper changer

Postby viking60 » 04 Jan 2012, 23:02

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...)
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"

User avatar
jemadux
Viking
Posts: 37
Joined: 13 Oct 2010, 19:07

Re: Gnome3 wallpaper changer

Postby jemadux » 20 Jan 2012, 19:21

oh thanks viking

User avatar
viking60
Über-Berserk
Posts: 9351
Joined: 14 Mar 2010, 16:34

Re: Gnome3 wallpaper changer

Postby viking60 » 20 Jan 2012, 23:22

Your welcome :greetings
Manjaro 64bit on the main box -Intel(R) Core(TM) i7 CPU 920 @ 2.67GHz and nVidia Corporation GT200b [GeForce GTX 275] (rev a1. + Centos on the server - Arch on the laptop.
"There are no stupid questions - Only stupid answers!"


Return to “Tips & Tricks”