Ubuntu – mapping between dconf dump output and gsettings schemas

dconfgnomegsettingsubuntu-mate

For example :

dconf dump / | grep mouse
[org/mate/desktop/peripherals/mouse]
....

So if I want to make a gsettings command based on this output, I look to gsettings to list the schemas, but….

(output edited to include only likely candidates ):

gsettings list-schemas | grep mouse
....
org.mate.peripherals-mouse
org.gnome.desktop.peripherals.mouse
org.mate.SettingsDaemon.plugins.mouse
....

So it is not clear to me which of these mouse schemas I should use. My understanding is that gsettings is a command line interface to the dconf database, but there is no clear correspondence between gsettings data and dconf data — as far as I can see.

Can someone explain or point me to explanatory documentation. Thanks.

Best Answer

Typically, dconf schemas translate nicely into gsettings schemas by replacing slashes with dots and vice versa.

In your example, org.mate.peripherals-mouse is the closest matching for what I'd expect to be a static schema.

However, not all gsettings schemas translate nicely. There's something known as relocatable schemas:

A relocatable schema is what you need when you need multiple instances of the same configuration, stored separately. A typical example for this is accounts: your application allows to create more than one, and each of them has the same kind of configuration information associated with it.

For such cases, schema also requires a particular path added to it. For example,

gsettings set org.compiz.unityshell:/org/compiz/profiles/unity/plugins/unityshell/ dash-blur-experimental 1

Here's another example from one of Budgie desktop schemas:

$ dconf write /com/solus-project/budgie-panel/panels/{5f6251f2-9d09-11e8-be4b-d053493d53fd}/size 52
$ gsettings set com.solus-project.budgie-panel.panel:/com/solus-project/budgie-panel/panels/{5f6251f2-9d09-11e8-be4b-d053493d53fd}/ size 52

Typically paths for relocatable gsettings schemas are the same as for dconf, but it's not guaranteed from what I understand. Manual way would be to run dconf watch / and use GUI buttons/sliders/preferences menus to figure out which schemas are controlled by those.