3

I'm backup/syncing my dotfiles in my $HOME-Directory via git. I don't want to sync everything of course, so I ignore everything via .gitignore and re-add the important files.

*

!.bash*
.*.swp
.bash_history
.bash_local
.bash_logout
!.profile

Which files are necessary to back up in an Ubuntu Gnome environment which belongs to the system settings, like user-specific preferences or theme settings?

3
  • Most of it is stored in a binary database (gsettings/dconf, look in ~/.config/dconf), so it's not suitable for Git.
    – Olorin
    Mar 12, 2019 at 11:22
  • @Olorin why not? Mar 12, 2019 at 11:38
  • @StephenKitt if you're OK with keeping binary files with possibly frequent changes in Git, go ahead.
    – Olorin
    Mar 12, 2019 at 11:49

1 Answer 1

6

Since GNOME settings are generally stored via the GSettings API, and some of those files are binaries/databases, your best bet is to rely on dconf tool:

To export settings:

dconf dump / > dconf-settings.ini

To import settings:

dconf load / < dconf-settings.ini

You could save the contents of $XDG_CONFIG_HOME/dconf(most of the time, it represents ~/.config/dconf) but that would not be suitable for git since those files are not plaintext.

This Gnome Settings export will also contain all settings related to Mate Desktop and Cinnamon Desktop since they are objects inside the root schema ( / ). To export those desktops settings only:

Cinnamon:

 dconf dump /org/cinnamon/ > dconf-cinnamon.ini

Mate:

dconf dump /org/mate > dconf-mate.ini

Backup custom themes.

To backup your custom themes/icons, compressing the folders ~/.icons and ~/.themes should be enough. Maybe you should keep the original theme files you already have at your home dir...

2
  • It would be better using gsettings instead of dconf, which is more portable and reasonable. gsettings use schema id while dconf as low-level implementation detail use schema path. Mar 12, 2019 at 12:30
  • And how would you export all Gnome configurations using a one-liner wth gsettings? Do you have an example since, even inside Gnome Documentation dconf seems to be the right tool to dump configurations while gsettings is only to set, monitor and get those values? - systutorials.com/docs/linux/man/1-gsettings - Also, this document has no examples so, it's hard to see gsettings as the adequate tool for this task...
    – user34720
    Mar 12, 2019 at 16:29

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .