How to migrate gedit settings?
So I've just had to do a reinstall and as part of that process, I'm starting a new account to remove some of the crufty config I've built up over time.
I've been fairly successful cherry-picking certain applications' configuration by copying over their old directories but gedit
is being a pain.
I've already copied over the following:
.gconf/apps/gedit-2
.local/share/gedit
.config/gedit
And that has allowed me to use my old plugins but nothing else. It's not remembering colours, which plugins were enabled or individual plugin config.
I'm coming from the same version of Ubuntu so would have expected this to cater for all my settings. I'm afraid there might be config stuck in dconf
.
Solution 1:
gedit keeps some of it's preferences in gnome registry.
You can see them if you spawn gconf-editor and visit /apps/gedit-2
To export use sth like
gconftool --dump /apps/gedit-2 > gedit.settings
then copy the gedit.settins file and import with
gconftool --load gedit.settings
(or play with ~/.gconf directory but it may be less safe)
Update: some of the attributes may be not set just for gedit, but more generally. A few searches in gconf-editor may help locating them.
Solution 2:
I would first jump to the conclusion that you are correct about these settings being saved by dconf. The first thing I did was run
locate gedit
I looked through and did not find much else besides what you already mentioned. I then took up to finding where the dconf settings are saved and determined you would check the settings using either
dconf list /org/gnome/gedit/
or read the actual settings replacing 'list' with 'read' once you locate the setting you wish to read using the list command.
I think the simplest option is to copy ~/.config/dconf/
and all subdirectories unless you can determine which user dir is yours.
The other alternative is to use dconf dump
and dconf write
You can find a lot of information you need here: At the bottom of this page
Solution 3:
You were right about config being stuck inside dconf, that's where gedit's settings live. I wouldn't advise porting them across versions though, there's no guarantee they'll be compatible and you may get all sorts of nasty results. Try getting both source and target gedit installations to the same version before you attempt migrating the settings.
So, to do what you asked, you might first store the config dump in a file named gedit-dump.conf
:
dconf dump /org/gnome/gedit/ > gedit-dump.dconf
Then, on the target machine, you'd load that file:
dconf load /org/gnome/gedit/ < gedit-dump.dconf
You knew the settings might be in the dconf database, so you could actually have checked where they were on your own:
dconf dump / | grep gedit
If you need, you can clean up gedit's settings with:
dconf reset -f /org/gnome/gedit/