LinuxCommandLibrary

dconf-read

Read a setting from the Dconf database

TLDR

Print a specific key value

$ dconf read /[path/to/key]
copy

Print a specific key [d]efault value
$ dconf read -d /[path/to/key]
copy

SYNOPSIS

dconf read KEY

PARAMETERS

KEY
    Slash-separated path to the dconf key (e.g. /org/gnome/nautilus/preferences/show-desktop)

DESCRIPTION

dconf read is a command-line tool from the dconf package used to retrieve the value of a specific key from the dconf configuration database. dconf serves as a low-level key-based configuration system in GNOME and other desktop environments, storing settings in an efficient binary format accessible via D-Bus. This command is invaluable for debugging, scripting, and inspecting runtime configurations without altering them.

It takes a single argument: the key path, a slash-separated string like /org/gnome/desktop/interface/gtk-theme. The output is formatted for safe shell parsing, with strings quoted and escaped (e.g., 'Ubuntu'). Numbers, booleans (true or false), and lists/arrays are serialized appropriately.

Unlike gsettings, which layers on schemas and defaults, dconf read accesses the raw database directly. Thus, unset keys yield no output and exit code 1, ignoring schema defaults. It's commonly used in shell scripts to check or log settings, such as window manager behaviors or panel configurations. The tool requires the dconf service or direct DB access, typically available in user sessions.

Ideal for GNOME users and developers, it integrates with tools like watch for monitoring changes.

CAVEATS

If key does not exist, prints nothing and exits with status 1.
Output is shell-escaped; use eval carefully in scripts.
Does not show schema defaults for unset keys.

EXAMPLE

dconf read /org/gnome/desktop/interface/mono-font-name
'Monospace 10'

SHELL USAGE

theme=$(dconf read /org/gnome/desktop/interface/gtk-theme); echo "Current theme: $theme"

HISTORY

Introduced with dconf 0.4.0 in 2010 by Ryan Lortie (Collabora) for GNOME 2.32+, replacing GConf with a faster binary DB.

SEE ALSO

dconf(1), gsettings(1), dconf-editor(1)

Copied to clipboard