This is a basically 'academic' question — to try to understand better the configuration system innards.
I understand that the dconf system is the new configuration system in gnome3 that has replaced the (deprecated) gconf; this is quite clear from Gconf, Dconf, Gsettings and the relationship between them.
It seemed to me that the programs gsettings
and dconf-editor
where just two different way to access the same dconf database, which is corroborated in
What is dconf, what is its function, and how do I use it?
EDIT: I discovered that someone noticed it as a difference in case in some schema name, see here — Are dconf schema names case-sensitive?; but it seems that the differences are not restricted to that. In one of the answer there is an example of mismatch, but I didn't find an explication of why.
But lately I discovered that the keys accessible from gsettings
and dconf-editor
are not the same. For example, settings for vino
are in dconf-editor
under org.gnome.desktop.remote-access
(see screenshot below) while in gsettings they are under org.gnome.Vino
. There is some documentation that explain the difference?
In gsettings:
(0)samsung-romano:~/tmp/try% gsettings list-recursively org.gnome.Vino
org.gnome.Vino alternative-port uint16 5900
org.gnome.Vino authentication-methods ['none']
org.gnome.Vino disable-background false
[...]
and:
(0)samsung-romano:~/tmp/try% gsettings list-recursively org.gnome.desktop.remote-access
No such schema 'org.gnome.desktop.remote-access'
But in dconf-editor:
Best Answer
dconf-editor
usesschema path
to show settings data tree. Same structure used to store data in GVariant database.gsettings
(from glib-2.0) usesschema id
to show/get settings data. Same way as any other application should do which uses GSetttings API.It's up to the application developer to set both as he/she would like. (with some restriction for canonical naming). So
path
could be different thanid
but most application developers prefer to use identical word series/combination. Some don't preserve same capitalization. Example Tracker project from GnomeIn addition to that, some alternative applications share same settings which belong to the Gnome desktop. Example:
input-sources
First, Apps should not mess with
dconf
Introduction from dconf project page:
dconf
is a low-level configuration system. Its main purpose is to provide a backend to GSettings on platforms that don't already have configuration storage systems.Where's the data stored? (Ref: https://wiki.gnome.org/Projects/dconf/SystemAdministrators)
A profile is a list of configuration databases. What it seems that Gnome & Unity use same profile.
user-db:user
: First database in the profile is read-writerw
and it is created in the user's home directory.system-db:gdm
: read-onlydconf
could bind a text style store in addition to GVariant Database fromdb.d/*
folder. Example (Notice file path, so it is a part ofsystem-db:gdm
):Schema Files: Relation between
schema id
&schema path
(*.gschema.xml
)What is the schema XML file in the data/glib-2.0 folder of my Quickly application? by trent shows a nice example of using GSettings API in a Quickly application, and his conclusion based on his experience.
Back to Vino. Each application that uses GSsettings should define its schema's and should store/install them in
/usr/share/glib-2.0/schemas/
(It's a glib directory):If you noticed, The schema is defined with an
id
and apath
. The schema file name follows theid
value.*.enums.xml
files are for custom enumeration declaration, to be used as new data types in*.gschema.xml
with sameschema id
.Compiling Schema's (Ref: Playing with dconf and gnome-tweak-tool)
As part of the installation process (it has a dpkg trigger), schema's are compiled with
glib-compile-schemas
tool (from glib)*.gschema.xml
will be compiled to a binary file/usr/share/glib-2.0/schemas/gschemas.compiled
Vendor Override Files (
*.gschema.override
)In addition to schema files,
glib-compile-schemas
reads vendor override files, which are key files that can override default values for keys in the schemas (Ref:man glib-compile-schemas
). They contain the changes done by Ubuntu distribution to override upstream schema defaults.Example of override files use, See How to customize the Ubuntu Live CD? (5. Customization 2: Backgrounds and Themes).
Lock files
Currently, dconf supports only per-key locking, no sub-path lock. User defined values will still be stored in
user-db
but will have no effect on applications. dconf/gsettings returns default values instead for those locked keys. Lock files are stored indb.d/locks/
. Example:After locks modification, to be effective run:
A good showcase: dconf Settings: defaults and locks
Changing Global Settings
The default for
gsettings
/dconf-editor
is to edit theuser-db
. To changesystem-db
, write a new override file and recompile schema's.I couldn't get this to work:
neither the other answers here Set Default/Global Gnome Preferences (Gnome 3), may be that was for an old release.