[lug] making gnome re-read config

Zan Lynx zlynx at acm.org
Tue Jan 10 10:11:43 MST 2006


On Mon, 2006-01-09 at 21:00 -0700, D. Stimits wrote:
> I'm trying to find out how to make gnome re-read its config file without 
> ending the gnome session (using Fedora Core 4). The goal is to edit the 
> background image in the XML file, and have it update that image based on 
> something like an alarm clock or cron. So far kill -HUP, -SIGUSR1, and 
> -SIGUSR2 do not do this...they end the session entirely. Obviously the 
> manager application knows a way, but maybe it's API related and not a 
> signal. Anyone have any hints on what would cause gnome to re-read its 
> config for an individual user without ending the session, and without 
> user intervention (other than setting up the alarm clock program)?

Here is what I use in my random background Perl script:
        system(
                '/usr/bin/gconftool-2', '-s',
                '-t', 'string',
                '/desktop/gnome/background/picture_filename',
                $new_image
        );

Editing the XML file is also an option, but trickier, as you're finding
out.  Sending gconfd a HUP tells it to flush its data caches and reload
data from disk, but it doesn't check for changes in order to send
notification signals.  You'd need some way to tell Nautilus to check for
a changed background, or kill it and let it restart.

Easier to use gconftool-2.
-- 
Zan Lynx <zlynx at acm.org>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: This is a digitally signed message part
URL: <http://lists.lug.boulder.co.us/pipermail/lug/attachments/20060110/66c164c0/attachment.pgp>


More information about the LUG mailing list