Broken Gnome, Help needed

Ralf Mardorf kde.lists at yahoo.com
Sun Sep 11 12:18:49 UTC 2022


On Sun, 2022-09-11 at 11:20 +0200, Volker Wysk wrote:
Am Samstag, dem 10.09.2022 um 21:31 +0200 schrieb Ralf Mardorf:
> > PS: I forgot to point out that you can backup and restore your
> > current settings using
> >   
> > dconf
> >   dump              Dump an entire subpath to stdout
> >   load              Populate a subpath from stdin
> > 
> > or
> > 
> > copy
> > 
> > ~/.config/dconf/user
> 
> Actually, I have a backup of the Gnome settings. It's in my backup
> script, where I included it years ago. It does it like this: 
> 
> gsettings list-recursively > ...
> 
> Now I'm wondering how to restore the settings. I've read the gsettings
> manpage, but it doesn't make much sense for me. Looks incomplete.
> 
> Do you know how to do it?

Hi,

by a script that either converts the schema/key syntax of the gsettings
command to the path/key syntax of dconf and then by using the dconf
command's write or load option or by a script that does use the
gsettings command's set option.

$ gsettings list-recursively | grep mousepad | head -1
org.xfce.mousepad.plugins.gspell.preferences default-language 'en_US'

"list-recursively" does automagically what you can do with "get" and a loop.
The counterpart to "get" is "set".

$ gsettings get org.xfce.mousepad.plugins.gspell.preferences default-language
'en_US'
$ gsettings set org.xfce.mousepad.plugins.gspell.preferences default-language 'de_DE'
$ gsettings get org.xfce.mousepad.plugins.gspell.preferences default-language
'de_DE'
$ gsettings set org.xfce.mousepad.plugins.gspell.preferences default-language 'en_US' 
$ gsettings get org.xfce.mousepad.plugins.gspell.preferences default-language
'en_US'

IOW you need a script with a loop and the set option.
It's the same when using the dconf command's write option:

$ dconf write /org/xfce/mousepad/plugins/gspell/preferences/default-language "'de_DE'"
$ dconf read /org/xfce/mousepad/plugins/gspell/preferences/default-language
'de_DE'
$ dconf write /org/xfce/mousepad/plugins/gspell/preferences/default-language "'en_US'"
$ dconf read /org/xfce/mousepad/plugins/gspell/preferences/default-language
'en_US'

The dconf commands load option is the counterpart to its dump option,
hence your script doesn't need a loop, but since you use theĀ 
gesettings list-recursively option to redirect the output to a file, you
need to convert the content, e.g.

org.xfce.mousepad.plugins.gspell.preferences default-language 'de_DE'

needs to be converted to

/org/xfce/mousepad/plugins/gspell/preferences/default-language "'en_US'"

This can be done by a script e.g. using the set command.

The easiest way is what Colin and I mentioned...

On Sun, 2022-09-11 at 11:42 +0100, Colin Law wrote:
> In my routine backup I backup .config/dconf/user

...just copy ~/.config/dconf/user .

Regards,
Ralf





More information about the ubuntu-users mailing list