33

I have installed dconf-tools. In this case I am manipulating the display of a name in the panel on the session indicator.

I can change this in dconf-editor gui with no problem, I go to apps/indicator-session, and untick show-real-name-on-panel.

However, I have also tried to toggle it just using dconf at the command line:

dconf write /com/canonical/indicator/session/show-real-name-on-panel false

After rebooting, the panel is unchanged, and the key in the dconf-editor is unchanged as well.

Moreover, trying to update the dconf database via the terminal yields an error:

$ dconf update
fatal: Error opening directory '/etc/dconf/db': No such file or directory

From my experience it seems as though dconf and dconf-editor have no relationship, so I just wonder what I am doing wrong.

If I can get this figured out, I want to just place the command in a bash script to run the next time I have to do a clean install for an upgrade*. I do a lot of tweaks in 6 months and I just want to automate as much as possible from now on.

  • Slightly off-topic: the distribution upgrade mechanism has never worked without a hitch for me; I tried it going from 11.04 to 11.10 as well.
37

You can use the gsettings tool.

gsettings set com.canonical.indicator.session show-real-name-on-panel false
| improve this answer | |
  • Thank you, that worked! Does that work anywhere that dconf would? Is it going to be deprecated in favor of dconf, or will it continue to be used for the foreseeable future? – Inkayacu Oct 25 '11 at 21:41
  • Yes, gsettings can be used anywhere dconf would. – Anonymous Oct 25 '11 at 21:43
  • 1
    No, it will not be deprecated. dconf replaced gconf which will be deprecated. gconf can be changed with gconf-editor or gconftool-2. dconf can be changed with dconf-editor or gsettings. – Anonymous Oct 25 '11 at 21:45
  • gconf saves its files in your home directory under the .gconf/ directory. – Anonymous Oct 25 '11 at 21:46
12

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.

| improve this answer | |
  • 1
    This requires a desktop terminal / gui to run. Otherwise, it errors spawning dbus-launch. It doesn't work with ssh. – Chase T. Jan 13 at 15:49
10

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. https://github.com/andsens/homeshickhomesick is my current favorite method.

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

| improve this answer | |
2

It seems (at least in 15.10) that there are some things (specifically compiz) which only store config at the dconf layer and can't be set via gsettings. It's possible this affects other config paths, but probably unlikely - since compiz is at a lower layer than unity I'm not surprised it behaves differently.

For example, this will work:

dconf write /org/compiz/profiles/unity/plugins/core/outputs "['3200x1800+288+2160', '3840x2160+0+0']"

while this will not:

gsettings set org.compiz.profiles.unity.plugins.core outputs "['3200x1800+288+2160', '3840x2160+0+0']"
# No such schema 'org.compiz.profiles.unity.plugins.core'

Now if only I could figure out how to reload compiz without crashing everything...

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.