How do I change dconf keys without a gui (for a post-install script)?

You can use the gsettings tool.

gsettings set com.canonical.indicator.session show-real-name-on-panel false

The following worked for me on Ubuntu 14.04:

dconf write /org/gnome/gnome-session/auto-save-session true

The value did change and stayed changed after reboot. I had another problem that the windows weren't saved but that's a whole different issue.


dconf dump + load mass export and restore

  1. Dump all settings to a file:

    dconf dump / >~/.config/dconf/user.conf
    
  2. Open that file on a text editor and select the settings that you care about:

    editor ~/.config/dconf/user.conf
    

    If you use Vim, you will want this syntax highlight.

  3. If you don't know the name of the setting, but know how to modify it from a GUI like unity-control-center, run:

    dconf watch /
    

    and then modify them. The exact setting will then appear on the terminal.

  4. When you want to restore those settings, run:

    dconf load / <~/.config/dconf/user.conf
    
  5. Git track the config file to never lose it. homeshick is my current favorite method.

Tested on Ubuntu 15.10. Tip adapted from: http://catern.com/2014/12/21/plain-text-configuration-gnome.html

Tags:

Dconf