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 gsettings tool 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. gsettings uses XML for schema files, but a separate ini-style format for override files. Everybody wins?
  • glib-compile-schemas requires 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/schemas alongside 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-schemas which non-the-less is broken. The result is gsettings clients, including the gsettings binary itself, complaining and then segfaulting. Do not rely on glib-compile-schemas to ensure compliant override files.
  • glib-compile-schemas would 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.override to sort after 10_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

comment 2
Thanks for the link, that looks like a useful (and developing) resource. I would ask, though, why should I solve the problem with dconf rather than gsettings, or vice versa?
jmtd,
comment 3

Two short links: * dh_installgsettings(1) * http://malsain.org/static/debian/201302-Brussels/UnderstandingGnomeInternals.pdf

Comment by Np237,
comment 4
Thanks! The systems in question are not Debian ones but a quick scan over those two links suggests that much will be useful to me non-the-less. Appreciated!
jmtd,