3

I have several computers running MATE desktop and I want to merge their setup (and keep them in sync afterwards). With dconf dump / I can get configuration details, but comparing the output (with meld) is hopeless as the order in which entries are presented is not the same, thus a manual, intelligent merge is not feasible.

Alternatively, I can use gsettings list-recursively which gives a list which can be sorted and then compared, but I do not see how to write back the result (there is no command like dconf load for this file format).

I see possible approaches:

  • sort the output of dconf dump (there should be some utilities, but I could not find any)
  • a gsettings write-many function, as an inverse of gsettings list-recursively)
  • convert gsettings list into the dconf dump format
  • sort the dconf dump list.

What is easiest with existing tools? considering the discussion and here my goal of keeping configurations in sync may not be very easy.

As examples, I include short pieces of the two list formats I currently have:

gsetting produces (extract):

org.gnome.rhythmbox.podcast-source paned-position 180
org.gnome.rhythmbox.podcast-source sorting ('Feed', true)
org.blueman.transfer opp-accept false
org.blueman.transfer shared-path ''
org.mate.Caja.Sendto last-compress 0
org.mate.Caja.Sendto last-medium ''
org.gnome.evolution-data-server.calendar contacts-reminder-interval 15

and dconf dump (different extract):

[apps/light-locker]
idle-hint=false
late-locking=false
lock-after-screensaver=uint32 0
lock-on-lid=false
lock-on-suspend=false

[ca/desrt/dconf-editor]
saved-view='/org/mate/caja/'
window-height=600
window-is-maximized=false
window-width=800
2
  • It would help if your gsetting and dconf dump fragments described the same part of the configuration. The gsetting output is easier to work with - each line is complete. But, in either case, filter the transferred config - only transfer SOME (manually specified) config items. Maybe it's time to learn Perl?
    – waltinator
    Nov 21, 2020 at 17:18
  • 1
    Running gsettings list-recursively | sort -u would be good starting point.
    – N0rbert
    Nov 21, 2020 at 17:21

1 Answer 1

2

For the time being, i found a simple solutoin:

I found that the dump received from dconf is changing only little when updated. Therefore, it is sufficient to start with loading initially a dump and then update the configuration gradually and produce a new dump. The initial and the final dump can be compared with meld; merging is possible.

I use this with ansible, having a currentTargetDump copied to other machines and loaded. This makes all ansible host computers having the same configuration.

Before I load the new configuration I take a dump of the current configuration. I can compare the current configuration with the target configuration with Meld and merge changes into the target configuration and write it back to serve as the future target configuration which is distributed to all hosts.

Seems simple and work well so far.

1
  • For this case dconf is better then gsettings because it does dump only changed settings (from default ones). For sorting dconf dumps, they are similar to Windows INI format. So you may you the perl script mentioned in this answer serverfault.com/a/28199/79479
    – user.dz
    Nov 27, 2020 at 18:36

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.