1

As much as I know the files that keep the various programs' settings are placed in ~/config/[program].
Today I've encountered to question 1035307.
The answer mentioned dconf reset -f /org/gnome/gedit/ command, and when I entered that command in my terminal all of my settings in gedit have been reverted to default.

Now I'm wondering how dconf has reset my settings! Did it just rewrite all of the configurations with the default one?

  • From what I understand, an application may store its settings in ~/.config/dconf/user or in application-specific files or folders in ~/.config or even in your home folder. Some examples of gtk applications: firefox uses ~/.mozilla, geany uses ~/.config/geany/geany.conf, mousepad (Xubuntu's text editor) and gedit use ~/.config/dconf/user. I don't think resetting defaults via dconf reset will affect those programs that do not use ~/.config/dconf/user. Then there are other non-GTK applications (qt) such as okular that obviously don't use ~/.config/dconf/user. – DK Bose Nov 10 '18 at 11:00
  • @DKBose Thanks for your comment! so using dconf reset command just works on gtk-based application? if yes, then how can I reset qt-based applications seetings back to their defaults? – Mohammad Hossein Nov 11 '18 at 06:59
  • The question about qt-based apps should be asked as a separate question. – DK Bose Nov 11 '18 at 10:58

1 Answers1

3

The best method to determine what was changed is to place parts of your home folder under source code version control system such as Git.

While using such method you can determine that one binary file was changed - it is named ~/.config/dconf/user. So the short answer is yes - the file was changed.

Personally I'm using the following method to determine what was changed after editing settings of some application (from GUI, with dconf/dconf-editor or by gsettings):

  1. I save current settings to the files

    dconf dump / > /tmp/dconf_before
    gsettings list-recursively | sort --unique > /tmp/gsettings_before
    
  2. Then I change some settings.

  3. Afterwards I save new settings to the files

    dconf dump / > /tmp/dconf_after
    gsettings list-recursively | sort --unique > /tmp/gsettings_after
    
  4. Compare obtained files with meld (visual diff tool):

    meld /tmp/dconf_before /tmp/dconf_after
    meld /tmp/gsettings_before /tmp/gsettings_after
    

Free bonus: you can create small dconf- or gsettings-based dumps to apply the settings from terminal and get settings that you like with one long command:

* using dconf:

dconf load / << EOF 
[org/gnome/gedit/preferences/editor]
display-right-margin=true
highlight-current-line=true
display-overview-map=true
bracket-matching=true
auto-save=true
create-backup-copy=true
display-line-numbers=true
insert-spaces=true
background-pattern='grid'
wrap-last-split-mode='word'
auto-indent=true

[org/gnome/gedit/preferences/ui]
show-tabs-mode='auto'

[org/gnome/gedit/plugins]
active-plugins=['time', 'quickopen', 'filebrowser', 'spell', 'pythonconsole', 'sort', 'externaltools', 'modelines', 'snippets', 'docinfo']

EOF

* using gsettings:

org.gnome.gedit.preferences.editor auto-indent true
org.gnome.gedit.preferences.editor auto-save true
org.gnome.gedit.preferences.editor background-pattern 'grid'
org.gnome.gedit.preferences.editor bracket-matching true
org.gnome.gedit.preferences.editor create-backup-copy true
org.gnome.gedit.preferences.editor display-line-numbers true
org.gnome.gedit.preferences.editor display-overview-map true
org.gnome.gedit.preferences.editor display-right-margin true
org.gnome.gedit.preferences.editor highlight-current-line true
org.gnome.gedit.preferences.editor insert-spaces true
org.gnome.gedit.preferences.ui show-tabs-mode 'auto'
org.gnome.gedit.plugins active-plugins ['time', 'quickopen', 'filebrowser', 'spell', 'pythonconsole', 'sort', 'externaltools', 'modelines', 'snippets', 'docinfo']
N0rbert
  • 99,918