News for hackers. Stuff that matters.
Re:The Joy of Linux Desktop Environments by lima on Thursday November 17, 2016 @02:51PM (#12980818)
Gnome re-created the registry because they needed features that plain text files don't have.

I simply have a hook for my dotfile repo which calls "dconf dump / > .dconf". This dumps the entire tree and it's nicely versioned in the repo.

Re:The Joy of Linux Desktop Environments by CaptSpify on Thursday November 17, 2016 @05:00PM (#12982128)
Curious what features a plain-text file doesn't have that a registry would?
Re:The Joy of Linux Desktop Environments by lima on Thursday November 17, 2016 @05:33PM (#12982377)
Most importantly, a stable API which can be concurrently used by multiple processes.

Getting/setting single values in a plain text config file is cumbersome and error-prone, and even if there's a library which is able to read that particular format, it often clobbers comments and formatting. For systems administration, you usually solve this by generating the entire config file from a template since nothing on the server should change your config files anyway.

However, on the desktop, many different application want to read and write keys. Tray applets, the system config panel, even your media player... They would inevitably conflict and you'd have to implement file-based locking.

Another topic: real-time notifications. If you modify the text size in the Gnome Control Panel, what happens is that the panel modifies the value in dconf and dconf sends a notification to all running Gnome applications. You could implement this using inotify, but you'd need code in each of your applications to open the config file, parse it and figure out which setting actually changed.

Single dconf lookups are really fast since everything is zero-copy and doesn't involve any syscalls. This is much faster than opening, reading and parsing config files.

dconf doesn't aim to replace all plain text config files. Storing the i3 or SSH configuration in dconf would be stupid (or even using dconf on a server to begin with).

Re:The Joy of Linux Desktop Environments by alphapapa on Thursday November 17, 2016 @09:04PM (#12983735)
> Getting/setting single values in a plain text config file is cumbersome and error-prone

What? The INI format is very simple and there are numerous libraries that handle it cleanly in any language.

> and even if there's a library which is able to read that particular format, it often clobbers comments and formatting.

What? These are primarily machine-readable configuration files. Why is formatting relevant? And how are comments relevant to dconf, since it uses a binary format anyway?

If a plain-text file isn't good enough, at least have the decency to use SQLite.

Re:The Joy of Linux Desktop Environments by kosma on Thursday November 17, 2016 @05:54PM (#12982534)
> However, on the desktop, many different application want to read and write keys. Tray applets, the system config panel, even your media player...

If your applications directly read and store configuration keys belonging to other applications, you have way worse problems in your architecture than configuration file format.

Re:The Joy of Linux Desktop Environments by vetinari on Thursday November 17, 2016 @06:13PM (#12982682)
Configuration items like current theme or current default font are things, that all applications are interested in. If they want to have look and feel like the rest of the desktop, that is.
Re:The Joy of Linux Desktop Environments by alphapapa on Thursday November 17, 2016 @09:01PM (#12983715)
Yes, and read-only access requires no locking. Those settings should only be changed by the system control panel, not by random apps.
Re:The Joy of Linux Desktop Environments by vetinari on Friday November 18, 2016 @04:29AM (#12985500)
That opens another can of worms: What is system control panel: is that gnome control center? Or command line dconf tools? Or is that dconf-editor? Or one of the myriad tweak utilities?

Cut off one of these and brace for the whining, that gnome is dumbing everything down and locking up your settings.

Re:The Joy of Linux Desktop Environments by flukus on Thursday November 17, 2016 @09:11PM (#12983761)
> Most importantly, a stable API which can be concurrently used by multiple processes.

Lock files.

Re:The Joy of Linux Desktop Environments by willtim on Thursday November 17, 2016 @03:13PM (#12981042)
The issue for me is more that they recreated the windows registry with all its flaws. For example, when uninstalling an app, can every entry associated with that app be easily removed?
Re:The Joy of Linux Desktop Environments by okramcivokram on Thursday November 17, 2016 @03:25PM (#12981146)
If app is removed, are all the relevant dotfiles removed?
Re:The Joy of Linux Desktop Environments by willtim on Thursday November 17, 2016 @04:01PM (#12981509)
The registry was supposed to improve upon dotfiles. In practice there is often one dotfile to delete versus hundreds of scattered registry entries. If an Android app is removed, the local settings are also completely removed, because they didn't just copy the design of windows.
Re:The Joy of Linux Desktop Environments by lima on Thursday November 17, 2016 @04:52PM (#12982051)
> hundreds of scattered registry entries

This is unique on Windows. I actually took a look at dconf on my machine and no application occupied more than one key.

GEdit sits in /org/gnome/gedit and virt-manager in /org/virt-manager as you'd expect.

I also hate Android's behavior, since there are situations where you want to keep them. If I remove GEdit for whatever reason, I expect it to keep my settings.

There are legitimate reasons to criticize Gnome, but this isn't one of them. dconf is totally reasonable and has significant advantages over plain text.

Re:The Joy of Linux Desktop Environments by bwat48 on Thursday November 17, 2016 @03:58PM (#12981486)
Touche