LinuxCommandLibrary

dconf-write

Write a value to a dconf setting

TLDR

Write a specific key value

$ dconf write /[path/to/key] "[value]"
copy

Write a specific string key value
$ dconf write /[path/to/key] "'[string]'"
copy

Write a specific integer key value
$ dconf write /[path/to/key] "[5]"
copy

Write a specific boolean key value
$ dconf write /[path/to/key] "[true|false]"
copy

Write a specific array key value
$ dconf write /[path/to/key] "[['first', 'second', ...]]"
copy

Write a specific empty array key value
$ dconf write /[path/to/key] "@as []"
copy

SYNOPSIS

dconf-write KEY VALUE

PARAMETERS

KEY
    Hierarchical path to the dconf key (e.g., /org/gnome/terminal/legacy/profiles:/:/background-color)

VALUE
    GVariant-serialized value (e.g., 'true', 42, 'rgb(255,0,0)', ['red','blue'])

DESCRIPTION

dconf-write is a lightweight command-line tool for storing a single value in the dconf configuration database, the backend for GNOME settings management. dconf uses a binary, hierarchical key-value store, accessible via paths like /org/gnome/desktop/interface/, supporting types such as booleans, integers, strings, arrays, and variants.

It serializes the provided VALUE into GVariant format and commits it immediately to the user's dconf profile (or system-wide with elevated privileges). Ideal for shell scripts, automation, or quick tweaks without launching dconf-editor or using gsettings.

Keys follow slash-separated paths; values require proper quoting for complex types (e.g., lists as ['foo','bar']). No schema validation occurs—mismatches may cause application issues. Changes propagate to running apps via D-Bus signals.

Common use: configuring desktop behaviors, like dconf-write /org/gnome/desktop/interface/document-font-name 'Sans 11'.

CAVEATS

No options or flags; requires dconf write permissions (user DB by default, root for system). Invalid types/formats silently fail or corrupt settings. Not for bulk changes—use dconf-load.

EXAMPLES

dconf-write /org/gnome/desktop/background/picture-uri 'file:///path/to/wallpaper.jpg'
dconf-write /org/gnome/nautilus/preferences/show-create-link true
dconf-write /org/gnome/mutter/dynamic-workspaces false

HISTORY

Part of dconf (GNOME 3.2+, 2011), replacing GConf. Standalone dconf-write binary split from main dconf in v0.38.0 (2020) for sandbox security (Flatpak, etc.).

SEE ALSO

dconf-read(1), dconf-dump(1), dconf-list(1), gsettings(1), dconf-editor(1)

Copied to clipboard