Linux Archive

Linux Archive (http://www.linux-archive.org/)
-   Fedora User (http://www.linux-archive.org/fedora-user/)
-   -   Gnome 3: change wallpaper via commandline (http://www.linux-archive.org/fedora-user/561725-gnome-3-change-wallpaper-via-commandline.html)

Jitesh Shah 08-08-2011 04:17 PM

Gnome 3: change wallpaper via commandline
 
I have a pictures directory and a cron script that changes my
wallpaper every hour. For this, I need a way to change the wallpaper
via commandline.

On my F14 (Gnome 2), I used to just use gconf2 for the purpose
$ /usr/bin/gdconftool-2 -t string -s
/desktop/gnome/background/picture_filename "$PIC"
where $PIC = path to the wallpaper

However, this doesn't work on my Gnome-3 F15 install. A quick look at
the gnome-control-center/panels/background code suggests that
gnome-control-center doesn't do any gconf stuff to change the
wallpaper either.

What is the "latest and the greatest" way to change the wallpaper via
commandline? Did the gconf property migrate to some other directory?

Some useful info:
I am running F15.
$ rpm -q control-center
control-center-3.0.1.1-6.fc15.i686

Jitesh

--
Run away from difficulties to stand to fight them tomorrow.

http://aterriblewasteoflife.blogspot.com
http://nothingtechnicalaboutit.blogspot.com
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

Michael Cronenworth 08-08-2011 04:23 PM

Gnome 3: change wallpaper via commandline
 
Jitesh Shah wrote:
> What is the "latest and the greatest" way to change the wallpaper via
> commandline? Did the gconf property migrate to some other directory?

Gnome 3 uses GTK3, which uses GSettings instead of GConf for storage.

You want "dconf" instead of "gconf" for the command-line tool.
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

Jatin K 08-09-2011 04:24 AM

Gnome 3: change wallpaper via commandline
 
On Monday 08 August 2011 09:47 PM, Jitesh Shah wrote:
> I have a pictures directory and a cron script that changes my
> wallpaper every hour. For this, I need a way to change the wallpaper
> via commandline.
>
>
try this[1] script

http://pastebin.mozilla.org/1293995 make it executable and run it


Warm Regards

--
v
/(_)
^ ^ Jatin Khatri
Registerd Linux user No #501175
www.counter.li.org
No M$

--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

Jitesh Shah 08-09-2011 04:46 AM

Gnome 3: change wallpaper via commandline
 
..snip..

On Mon, Aug 8, 2011 at 9:24 PM, Jatin K <ssh.fedora@gmail.com> wrote:
> On Monday 08 August 2011 09:47 PM, Jitesh Shah wrote:
>> I have a pictures directory and a cron script that changes my
>> wallpaper every hour. For this, I need a way to change the wallpaper
>> via commandline.
>>
>>
> try this[1] script
>
> http://pastebin.mozilla.org/1293995 * * *make it executable and run it

The script has the following lines in it:

conf_client = gconf.client_get_default()
conf_client.add_dir("/desktop/gnome/background", gconf.CLIENT_PRELOAD_NONE)
conf_client.set_string("/desktop/gnome/background/picture_filename",
xml_file_path)

As I said in the first email, this (gnome-control-center doesn't use
gconf anymore to store background image information) has stopped
working. I haven't had an opportunity to go home, open up my laptop
and try dconf as Michael said, but gconf doesn't do the job anymore
since F15.

Cool script though. I'll spend some time on this today and let you
know the new command-line.


Jitesh
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines

Jitesh Shah 08-09-2011 06:17 AM

Gnome 3: change wallpaper via commandline
 
Jatin,

..snip..
>
> Cool script though. I'll spend some time on this today and let you
> know the new command-line.

I eventually ditched dconf too. "dconf write" kept saying that the
value needed to be in GVariant format. I did have a "file://" URI
specifier at the start. Anyway, I couldn't easily find what a GVariant
is, so I went over to gsettings.

It is a pretty straightforward change using gsettings. So now I am
using the command-line
/usr/bin/gsettings set org.gnome.desktop.background picture-uri "file://$PIC"

$PIC = full-path to the image file.

I just put this in a cron hourly script and it works like a charm :-)

Jitesh
--
users mailing list
users@lists.fedoraproject.org
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines


All times are GMT. The time now is 01:22 PM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.