Re: using gsettings / gconf in extensions



On Wed, May 25, 2011 at 11:55 PM, Giovanni Campagna
<scampa giovanni gmail com> wrote:
> Il giorno mer, 25/05/2011 alle 22.14 +1000, Tim Cuthbertson ha scritto:
>> Hi all,
>>
>> I'm planning to add some gsettings or gconf integration to Erick
>> Pérez's workspace indicator extension
>> (https://github.com/erick2red/shell-extensions) to allow the user to
>> configure the label text format. So I have a couple of questions:
>>
>> - Is gsettings or gconf preferred for extension code? I have the vague
>> impression that gsettings is newer and shinier, but not much more than
>> that.
>
> GSettings is the only supported configuration system for GNOME 3.0.
> GConf is deprecated (and it's likely to disappear soon from most
> systems).

Ahh ok, thanks.

>> - Is there a designated (or suggested) namespace or prefix that gnome
>> shell extensions should place their conf keys within, or shall I just
>> make something up? Should I put it inside
>> org.gnome.shell.extensions.<extension-id> or something?
>
> Currently, extensions that use GSettings use
> "org.gnome.shell.extensions.<extension-id>" and
> "/org/gnome/shell/extensions/<extension-id>", yes. I think you can
> follow that prefix, if you plan to have it hosted by
> gnome-shell-extensions GIT.
> Otherwise, it is better to use your own ID (like
> org.project.YourExtension and /org/project/YourExtension), to avoid
> clobbering namespaces you don't own.

It seems that either
(1) extension IDs should be unique (regardless of how they are distributed), or
(2) there could be a nested namespace, e.g
org.gnome.shell.extensions.net.gfxmonk.whatever.

I assumed that (1) was the case.

> Giovanni
>
> PS: note that extensions with GSettings must be installed system-wide,
> so you'd better have them in gnome-shell-extensions repo, so they're
> picked up by distribution packages.

Really? can I ask what the reason for this is? I am personally a
pretty big fan of *not* installing things system-wide, but would still
like to use GSettings...

Cheers,
 - Tim


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]