jmtd → log → GSettings
With GNOME 3, if you want to override a setting with a new site default,
assuming your app has been updated to use the new gsettings API and doesn't
still use the old gconf one, the best guide on what to do is still Ross
Burton's blog post from two years
ago,
although you can find most of what you need to know buried deep in the
GSettings C API
specification,
which is not the first place I would have looked (lesson learned!)
Note: In this context I'm in the role of systems administrator, rather than
distributor/vendor or software author. Whereas you are generally advised to use
gsettings itself and not poke at the backend (dconf for Linux), the
documentation seems to point sysadmins towards dconf hackery rather than
gsettings. However
gsettings worked for me, and I got nowhere with dconf direct.
Some caveats worth knowing about:
- Throughout the GNOME documentation and tools, "schema", "key" and "path" are used nearly interchangeably to mean roughly the same thing. (I think a path describes a key within a schema, to be precise.)
- schemas/keys/paths "must start with and end with a forward slash
character",
except when they mustn't, such as in override files, where you must use a
dot, and you don't prefix or suffix the schema/key/path with dots. In fact
the command line
gsettingstool only accepts dotted schemas, not slash-separated ones. - Sometimes, people choose XML, and save themselves the trouble of writing
a custom parser, but at the expense of ease for humans having to read or
write files.
gsettingsuses XML for schema files, but a separate ini-style format for override files. Everybody wins? glib-compile-schemasrequires a path argument, so all your schema and override files must be in the same place. Sites have to lump stuff into/usr/share/glib-2.0/schemasalongside distribution files, rather than separated out to (say)/usr/local/share/glib-2.0/schemas.- It's quite possible to get an override file past
glib-compile-schemaswhich non-the-less is broken. The result is gsettings clients, including thegsettingsbinary itself, complaining and then segfaulting. Do not rely onglib-compile-schemasto ensure compliant override files. glib-compile-schemaswould appear to read override files in native byte order, so make sure you name your override so that it sorts after any distribution-provided overrides. E.g.,20_my_gnome-shell.gschema.overrideto sort after10_gnome-shell.gschema.override.
Today I had to create 40 guest accounts on our 70-seat Linux cluster, including randomly generate passwords, set up persistent storage on our NFS server, etc.; quickly. As a nice-to-have I also wanted to add some application icons to the GNOME 3 "Favourite Apps" menu for the guests. Would you like to guess which of those jobs was the easier of the two?
Comments
Two short links: * dh_installgsettings(1) * http://malsain.org/static/debian/201302-Brussels/UnderstandingGnomeInternals.pdf