100

Mark Shuttleworth recently blogged about the decision to include the Qt libraries in the 11.10 release, with a followup from Jono Bacon. Mark states that the biggest challenge to integrating apps written in Qt into the larger Ubuntu system is Qt's current non-compatibility with dconf.

What is dconf, and what is the role it plays in Ubuntu?

1

3 Answers 3

112
+100

Introduction

As other answers on this site discuss gconf and dconf together, I will just concentrate on discussing command-line tools such as gsettings and the gui dconf-editor that are used to access the dconf database.

At the GNOME official site it is noted that

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.

dconf is a simple key-based configuration system. Keys exist in an unstructured database (but it is intended that keys that logically belong together are grouped together).

Having all of the keys in a single compact binary format also avoids the intense fragmentation problems currently experienced by the tree-of-directories-of-xml-files approach.

dconf is optimised for reads. Typically, reading a key from dconf involves zero system calls and zero context switches. Writes are less optimised -- they traverse the bus and are handled by a "writer" -- a DBus service -- in the ordinary way.

Using gsettings to view and change settings

Once one gets to know gsettings it can be as easy as the gui dconf-editor. The options can be listed by entering man gsettings or going to the Ubuntu manpages online.

NOTE: As everyone's system has different programs installed, you may have to substitute the specific items I choose for different ones when experimenting yourself, as I am using XUbuntu XFce with quite a lot of GNOME programs.

To list all the available schemas, enter

gsettings list-schemas

To also include all the keys, enter

gsettings list-recursively

However, it is usually easier to specify what you want with, for examples,

gsettings list-schemas | grep -i shotwell

This returns a long list; I have shortened it to:

org.yorba.shotwell
org.yorba.shotwell.preferences.ui
org.yorba.shotwell.preferences.slideshow
org.yorba.shotwell.plugins.enable-state
org.yorba.shotwell.printing
org.yorba.shotwell.preferences.editing
org.yorba.shotwell.preferences.files

Now when you have found the schema that you are interested in, list the keys with

gsettings list-keys org.yorba.shotwell.preferences.ui

This returns a list (again I have shortened it):

background-color
display-basic-properties
display-extended-properties
display-photo-ratings
display-photo-tags
display-photo-titles
event-photos-sort-ascending
event-photos-sort-by

Pick one and see what the current value is with

gsettings get org.yorba.shotwell.preferences.ui display-photo-tags

This returns a value of true, so to reverse it, use

gsettings set org.yorba.shotwell.preferences.ui display-photo-tags false

These are trivial examples, but show basically how keys and values are identified and changed with gsettings.

Using dconf-editor to change settings

The GUI program, dconf-editor is installed with dconf-tools package by clicking here or by running

sudo apt-get install dconf-tools

Then run it by entering in the terminal or in the quick launch menu, dconf-editor.

As you can see in the screenshot, all the various schemas can be expanded on the left hand side and the appropriate key selected. It is very straightforward to navigate to the value you want (in this case the gnome-mplayer preferences). You can click the check box to have a value activated or add a numerical value into one of the other boxes. You can also search within dconf editor with Ctrl+F keyboard shortcut.

enter image description here

You can also add another log say to log-viewer by adding a path in the form ['/var/log/auth.log', var....'] in the screenshot below.

enter image description here

Conclusion

There are many other useful ways that you can tweak settings with both gsettings and dconf-editor and they are straightforward to use. It is worth looking through them to see if there are options there that are not in the programs' preferences, as you may be able to customize your program just the way you want. As fossfreedom recently showed in this question

knowing how to use gsettings or dconf-editor is extremely valuable. See also:

7
  • 5
    Since the programs gsettings and dconf-editor work both on the dconf database, why don't they show the same information? gsetting on 12.04 shows values for the schema com.canonical.Unity.Launcher and the key favorites but dconf-editor does not even offer com.canonical.Unity let alone the full schema or the key.
    – A.H.
    Sep 22, 2012 at 11:10
  • @A.H: good question. I've asked it here: askubuntu.com/q/243409/2355
    – Flimm
    Jan 15, 2013 at 10:42
  • @A.H. I'm sorry that I forgot to answer your comment: I can't comment on Unity because I'm on Xubuntu, but Flimm has asked a separate question which should get some good answers.
    – user76204
    Jan 15, 2013 at 10:44
  • 4
    But what on earth makes dconf incompatible with Qt, a GUI toolkit?
    – Salman
    Apr 15, 2014 at 6:56
  • On RHEL / CentOS use yum install dconf-editor to install the GUI tool. Jun 4, 2017 at 19:33
35

For those coming from windows that want a simple reply, dconf is the gnome equivalent to the windows registry... a big binary tree where any program can store and share their configuration.

They first migrated from the traditional unix configs (one text files for each app, each with their own format) to a standard tree of XML files, managed by gconf. In recent times, as almost no one edited those XML files directly and the performance problems of reading and parsing MANY files, they migrated to a binary format by migrating from gconf to dconf.

Unlike windows registry, dconf should have all config entries listed, even if they are set to the default values. So there are no hidden entries, you can change then or reset then to default easily.

3
  • It's not only gnome equivalent, but all DE (Desktop Environment) equivalent. Most packages that are built for DE (Desktop Environment packages, like KDE, Xfce, Cinnamon packages and so on) have some configuration stored there. Sep 28, 2021 at 16:34
  • 3
    @R.W.Prado Not true, not all DE use dconf. While there are several Gnome forks and GTK based DE (GTK is the one that requires dconf ), there are lot more DE out there that do not use GTK and the main ones, usually QT based, like KDE, DO NOT use dconf: en.wikipedia.org/wiki/Dconf (search for kde). check wiki.archlinux.org/title/desktop_environment and see each DE package requirements, most, if not all, non-gtk DE do not use dconf
    – higuita
    Sep 28, 2021 at 21:58
  • 3
    Interesting! You completed my comment. My mistake was worth it =) Sep 28, 2021 at 22:48
13

dconf is not Ubuntu specific, it's the GNOME technology used to store application settings. For more details please read http://live.gnome.org/dconf

3
  • 1
    What is the relationship between dconf and gconf?
    – psusi
    Jan 19, 2011 at 19:29
  • 10
    dconf is the GNOME3 replacement for gconf which has not been maintained for some time. dconf is also expected to bring performance improvements over gconf (relevant for applications startup). Jan 19, 2011 at 22:50
  • 1
    The question in psusi's comment above is partially answered in the answers to the question "Why the controversy about dconf and gconf?". I'm sure psusi is aware of it, having commented on the question, but in case anyone else wants to know more, there it is. May 13, 2011 at 21:25

You must log in to answer this question.