Forum: Ruby-Gnome 2 accessing mandatory/defaults settings with Ruby/GConf2?

Posted by Nigel Kersten (Guest)
on 2010-02-11 22:48
(Received via mailing list)
I'm looking at possibly putting together a Puppet,
http://reductivelabs.com/trac/puppet/ , native type for manipulating
gconf2.

I've got the basic idea of Ruby/GConf2 down, but I can't see an
obvious way to manipulate the mandatory and defaults settings. Am I
missing something obvious?

thanks in advance,

Nigel
Posted by Nigel Kersten (Guest)
on 2010-02-16 18:11
(Received via mailing list)
On Thu, Feb 11, 2010 at 1:20 PM, Nigel Kersten 
<nigel@explanatorygap.net> wrote:
> I'm looking at possibly putting together a Puppet,
> http://reductivelabs.com/trac/puppet/ , native type for manipulating
> gconf2.
>
> I've got the basic idea of Ruby/GConf2 down, but I can't see an
> obvious way to manipulate the mandatory and defaults settings. Am I
> missing something obvious?
>
> thanks in advance,

Any ideas?
Posted by Simon Arnaud (Guest)
on 2010-02-17 10:20
(Received via mailing list)
2010/2/16 Nigel Kersten <nigel@explanatorygap.net>:
>
> Any ideas?

I'm a newby to GConf, but looking at
http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/desktop-guide/ch-intro-gconf-overview.html
it seems you open different database.

In your case /etc/gconf/gconf.xml.mandatory.

Here is a little example :

require 'gconf2'

mandatory_engine =
GConf::Engine.new("xml:readonly:/etc/gconf/gconf.xml.mandatory")
mandatory_client = GConf::Client.get_for_engine(mandatory_engine)
mandatory_client.all_entries("/").each do |entry|
  puts entry.key + " : " + entry.value
end

Create a mandatory key before you try the program, and restart gconfd.
Note I'm opening the DB readonly, you would want xml:readwrite if you
want to write to it.

Hope it helps

Simon
Posted by Marc Heiler (shevegen)
on 2010-02-17 14:14
By the way slightly off topic, but GConf will be replaced with another 
*Conf I think? I wonder how difficult it would be for ruby-gnome to keep 
up with that (if what I wrote is true, that is)
Posted by Nigel Kersten (Guest)
on 2010-02-17 15:16
(Received via mailing list)
On Wed, Feb 17, 2010 at 1:20 AM, Simon Arnaud <mazwak@gmail.com> wrote:
>>> thanks in advance,
>>
>> Any ideas?
>
> I'm a newby to GConf, but looking at
> http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/desktop-guide/ch-intro-gconf-overview.html
> it seems you open different database.
>
> In your case /etc/gconf/gconf.xml.mandatory.
>
> Here is a little example :

ah! Thanks, I was trying completely the wrong thing.


Much appreciated.
Posted by Simon Arnaud (Guest)
on 2010-02-17 15:56
(Received via mailing list)
2010/2/17 Marc Heiler <ruby-forum-incoming@andreas-s.net>:
> By the way slightly off topic, but GConf will be replaced with another
> *Conf I think? I wonder how difficult it would be for ruby-gnome to keep
> up with that (if what I wrote is true, that is)

I never heard of a gconf replacement.

And you second question is quite vague :).

simon
Posted by Simon Arnaud (Guest)
on 2010-02-19 15:51
(Received via mailing list)
2010/2/17 Simon Arnaud <mazwak@gmail.com>:
> 2010/2/17 Marc Heiler <ruby-forum-incoming@andreas-s.net>:
>> By the way slightly off topic, but GConf will be replaced with another
>> *Conf I think? I wonder how difficult it would be for ruby-gnome to keep
>> up with that (if what I wrote is true, that is)
>
> I never heard of a gconf replacement.

Just for the record, it seems Gnome is indeed switching to a new
settings engine.
It's still experimental though.

http://gnomejournal.org/article/89/gnome-boston-summit-2009
http://blogs.gnome.org/desrt/2009/06/09/some-nice-gsettings-facts/

Simon
Please log in before posting. Registration is free and takes only a minute.
Existing account (Switch to SSL-encrypted connection)
NEW: Do you have a Google/GoogleMail or Yahoo account? No registration required!
Log in with Google account | Log in with Yahoo account
No account? Register here.