You are not logged in.

#1 2011-05-07 21:28:08

pendor
Member
From: Tucumán - Argentina
Registered: 2008-09-24
Posts: 127

Gnome 3 change background script

I used a public domain perl script (by some Michael Moore) to change periodically the wallpaper under Gnome 2, here it is:

#!/usr/bin/perl -w
use strict;
use warnings;

my $searchPath = '~/wallpapers/';   # Set to the directory you want to have searched for photos
my $switchTime = 300;               # 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)];
    `gconftool-2 --type string --set /desktop/gnome/background/picture_filename "$photo"`;
    sleep($switchTime);
}


Of course, it doesn 't work under Gnome 3, because of the gconftool line.

I understand it is done this way now:
   
              gsettings set org.gnome.desktop.background picture-uri "file:///home/user/background.jpg"


But my perl skills are quite limited and my attempts to modify the script to the new way have failed miserably.
Is here someone more skilled than me can give me some help with this thing??
It's not incredibly important but I really really liked the wallpaper timed changing.
Thanx in advance.

Offline

#2 2011-05-08 01:56:37

kolos
Member
Registered: 2010-05-15
Posts: 55

Re: Gnome 3 change background script

change this line

`gconftool-2 --type string --set /desktop/gnome/background/picture_filename "$photo"`; 

for

 `gsettings set org.gnome.desktop.background picture-uri "file:///$photo"`; 

Last edited by kolos (2011-05-08 01:57:42)


och noes!

Offline

#3 2011-05-08 15:33:40

pendor
Member
From: Tucumán - Argentina
Registered: 2008-09-24
Posts: 127

Re: Gnome 3 change background script

I'm seriuosly indebted, it works like a charm!
Thanks a really lot, kolos!

:-)))))

Offline

#4 2011-05-13 00:35:09

arriagga
Member
From: Dominican Republic
Registered: 2010-04-01
Posts: 27

Re: Gnome 3 change background script

it really works,
thanks for this script.

Offline

#5 2012-10-20 07:10:45

dzup
Member
Registered: 2012-10-20
Posts: 1

Re: Gnome 3 change background script

Why not use a XML file? check this out https://github.com/dzup/borednomore  you can either make  your own XML file or use one of those scripts, one is for gconf2tool (gnome 2) and the other for gsettings (gnome 3) its for ubuntu/debian, but i see no difference between the way you guys call gsettings in arch, looks the same to me in debian, you may try it and told me if it does, thanks.

Offline

#6 2012-10-20 07:41:27

WonderWoofy
Member
From: Los Gatos, CA
Registered: 2012-05-19
Posts: 8,412

Re: Gnome 3 change background script

@pendor, you had all the information you needed right in front of you.  There was no need for perl skills whatsoever.


Edit:  I see now, you were trying to use a full path instead of the $photo variable set by the script.  Sorry for the noise...

Last edited by WonderWoofy (2012-10-20 07:42:58)

Offline

Board footer

Powered by FluxBB