News for hackers. Stuff that matters.
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by luma on Thursday August 11, 2022 @01:57PM (#32429470)
It really is a mess and it would be helpful if we had some sort of database for configuration that was reasonably standardized. Some sort of "registry" if you will :D
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by chasil on Thursday August 11, 2022 @02:05PM (#32429581)
...but preferably using the SQLite engine, and eschewing well-known proprietary formats.

https://news.ycombinator.com/item?id=32275078

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by fezfight on Thursday August 11, 2022 @03:33PM (#32430660)
Better yet, a flat file structure that you can grep with standard utilities. We can put it somewhere convenient, like in dot files in the users home directory. We can even add them to git with something simple like git add *.*
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by chasil on Thursday August 11, 2022 @03:58PM (#32430977)
As tempting as that may be, the ability to enforce ANSI SQL constraints (not null, unique, check, foreign key, etc.) could prevent many types of configuration errors.

If you want to grep everything in a sqlite database, then ".dump" it.

  $ echo "create table myconfig(param text, value text);
  insert into myconfig values('scrollbar', 'wide');
  insert into myconfig values('verbose', 'no');" | sqlite3 myconfig.db

  $ sqlite3 myconfig.db '.dump myconfig' | grep verbose

  INSERT INTO "myconfig" VALUES('verbose','no');
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by fezfight on Thursday August 11, 2022 @04:38PM (#32431430)
Good tips, thanks! I love sqlite3.
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by NavinF on Thursday August 11, 2022 @04:18PM (#32431207)
Yes! Let's also make every config file is its own special snowflake with its own syntax, keywords, and escape characters. That way, it's much harder for software to interact with these files and humans will have to write config templates for each deployment.

Oh and we might as well store these config file in a different place on each distro and move them around once in a while just to keep things interesting. Users can ignore upstream documentation and just strace the process if they wanna know where the files are this year.

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by codedokode on Thursday August 11, 2022 @04:49PM (#32431527)
You are suggesting good ideas, but we should go further. Let us write configuration files in Turing-complete exotic programming languages that almost nobody knows! This way malicious programs won't be able to parse them or perform automated edits, and many malicious humans too.
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by hsbauauvhabzb on Thursday August 11, 2022 @04:28PM (#32431298)
No need to get passive aggressive, parent has a legitimate point. Grep is a huge part of my workflow.
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by NavinF on Thursday August 11, 2022 @05:45PM (#32432101)
Ah I left out a few sentences. My passive aggressiveness is directed at the state of Linux distros today, not at the parent. I agree that his scheme is a lot better than the mess we deal with today.

> Grep is a huge part of my workflow.

You can flatten and grep structured binary formats too.

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by fezfight on Thursday August 11, 2022 @09:49PM (#32433953)
I honestly feel like you were just matching the tone of my comment so no harm done really. Mine was smarmy, yours passive aggressive. Its like a 90s sitcom in here!
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by fezfight on Thursday August 11, 2022 @04:37PM (#32431404)
Snowflakes are beautiful.
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by flukus on Thursday August 11, 2022 @11:40PM (#32434486)
Better yet, put it in a .rec file for the best of both worlds: https://www.gnu.org/software/recutils/
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by thayne on Thursday August 11, 2022 @10:09PM (#32434055)
Then you couldn't really use git (or any other kind of VCS) to version your config.

Also, not all config really lends itself to rows in a database (or some other binary registry). For example, commands to run on login. Or really anything where order matters, would be a pain to edit.

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by codedokode on Thursday August 11, 2022 @04:44PM (#32431486)
Why add just a monstrous database engine that will spend time reading and parsing database schema, parsing SQL queries, building execution plans to read several settings? Let's go further and use Elasticsearch (startup time about 1 minute) for this.
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by chasil on Friday August 12, 2022 @12:53PM (#32441134)
By these rules, we probably shouldn't link to the C library either.

  # ll /lib64/libc-2.17.so /lib64/libsqlite3.so.0.8.6
  -rwxr-xr-x. 1 root root 2156664 May 18 20:27 /lib64/libc-2.17.so
  -rwxr-xr-x. 1 root root  753272 Jan 27  2020 /lib64/libsqlite3.so.0.8.6
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by snikolaev on Monday August 15, 2022 @02:03AM (#32466354)
Or Manticore Search (startup time 2 seconds) :)

Manticore vs Elasticsearch startup time benchmark - https://manticoresearch.com/blog/manticore-alternative-to-el...

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by NavinF on Thursday August 11, 2022 @06:10PM (#32432423)
SQLite has identical performance vs parsing ad hoc text files assuming you're reading from flash not RAM. It's also a lot faster if you're loading a few settings from a larger file.
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by codedokode on Saturday August 13, 2022 @04:53AM (#32448059)
SQLite is inefficient. For example: it parses table definitions and SQL queries, builds execution plans at runtime, although this could be done at compile time.
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by NavinF on Saturday August 13, 2022 @05:59AM (#32448366)
Like I said it makes no difference when your SSD takes 40us to respond to a read. Maybe you have an exceptionally slow CPU?
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by overlisted on Thursday August 11, 2022 @02:04PM (#32429559)
GNOME has dconf[1], but it's only usable through D-Bus, which probably annoys the anti-systemd people

[1] https://en.wikipedia.org/wiki/Dconf

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by MichaelCollins on Thursday August 11, 2022 @02:19PM (#32429735)
It probably annoys most people who are accustomed to using their preferred text editor to configure their software, and it probably also annoys all the other users who are accustomed to using typical GUI preference windows accessed through the menus to change their configuration.

Things like dconf and about:config exists in no man's land, where neither generic GUI skills nor generic unixy skills are applicable.

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by forgotpwd16 on Thursday August 11, 2022 @02:30PM (#32429854)
>and it probably also annoys all the other users who are accustomed to using typical GUI preference windows accessed through the menus to change their configuration

How is this a problem with dconf? GNOME Settings for example is typical GUI preferences and works as a front-end to the dconf database.

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by MichaelCollins on Thursday August 11, 2022 @03:35PM (#32430693)
Last time I tried to use it, "GNOME Settings" (or whatever it was calling then) was woefully incomplete and I had to figure out that dconf-editor existed (which wasn't in the menus.)

Same problem with Firefox; hamburger->settings will take you to a GUI that contains maybe 0.01% of all the settings Firefox actually has. You have to be "in the know" to know that about:config exists. I think the first time most firefox users find out about about:config is when they're angrily searching the web for a solution to their problems, which is basically how I discovered dconf-editor too. You don't find either of these by searching through the GUIs like a normal computer user, nor will you find them by poking around in your dotfiles like a seasoned console jockey.

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by sillystuff on Thursday August 11, 2022 @04:16PM (#32431181)
And, once you have more than a trivial number of changes in about:config, you search for something that will allow you to have sane configuration management, and discover, the 'user.js' file.

Any setting in about:config can be set in user.js and your user.js file can be diffed, grepped, version controlled, edited with your favorite editor, and copied between profiles/machines.

Sadly, Mozilla is moving a lot of config out of about:config/user.js and into multiple random sqlite files, so sane config management is getting harder with each new release.

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by enduser on Thursday August 11, 2022 @02:42PM (#32430016)
It's not exactly a feature to have several layers of abstraction, when a text editor could suffice.
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by overlisted on Thursday August 11, 2022 @02:54PM (#32430144)
Unix will never to achieve true user-friendliness and wide adoption if we treat settings like this. The reality is that most people need a graphical, hard to break way of changing their settings to use your software.

Edit: Although I agree that some situations may require a readable text format, like a dotfiles repo. I personally use the `dconf-editor` program to find the right keys and the `dconf load` command to sync them from a regedit-like file format

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by umanwizard on Thursday August 11, 2022 @03:15PM (#32430403)
> Unix will never to achieve true user-friendliness and wide adoption if we treat settings like this.

I don't care. They can use OSes designed for their needs, like macOS and Windows.

Not sure why there is such a persistent idea that "everyone using Linux, including entirely non-technical users who just want an appliance" is actually a desirable or realistic goal.

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by GekkePrutser on Thursday August 11, 2022 @04:49PM (#32431537)
Agreed.

And the funny thing is that everyone does use Unix. Everyone with a smartphone does as both iOS and Android are derivatives of Unix-OSes (Darwin and Linux). Only Fuchsia will be truly non Unix. If it ever makes it out the door.

However those mobile OSes (or ChromeOS) are of course not what we're talking about when we say we love Unix. The same will happen if Linux ever makes it mainstream. Consumers might love it but we won't. I'm happy for it to stay a niche thing. My niche.

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by pxc on Friday August 12, 2022 @01:54AM (#32435094)
I recently disabled a service from running upon user login on a Windows PC, with a commitment to doing it in a way that can be automated and stored in source control.

I had to check literally more than a dozen locations in the registry (some in different hives) just to see where the thing was actually set to autoload. I then had to create new keys in still another location whose type was simply arbitrary binary data, and the only way to determine what actual value was needed there was to examine the registry before and after disabling and then reenabling the startup profile in the GUI.

The Windows registry is an absolute fucking shitshow, and it's a big part of the reason that the OS is inherently hostile to automation. The inherent invisibility of the registry and the systematic underdocumentation of registry schemas for applications and OS components makes figuring out how to do anything in a repeatable way a fucking quest.

> I personally use the `dconf-editor` program to find the right keys

For GUI applications, config files are often undocumented anyway. But to me having to run an application and see how it messes with its configuration in some database when you click buttons is an insane way to figure out how settings are declared or stored. I would so much rather the configuration format be plaintext and documented than be expected to reverse engineer my apps' friggin' config files!

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by jrockway on Thursday August 11, 2022 @04:09PM (#32431094)
It might not actually matter. Reboot Windows. Sound starts playing out of your monitor, which you didn't even know had speakers. How do you fix it?

(The answer is not to type "sound" into the search bar. That takes you to the "new" sound control panel, which doesn't have all the old features, including disabling sound devices. So you have to open the control panel, go to Devices & Sound, and then you can search around to disable a device.)

The fundamental difference between Windows and Linux here is that if you write an instructional blog post to fix this problem for Windows, you can put some drive-by malware installer on it and make some money. You could obviously malware up similar Linux documentation, but by the time you get discovered you will have only infected 1 person, simply because it's much less widely used. Unfortunate!

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by likeclockwork on Thursday August 11, 2022 @03:13PM (#32430370)
Plenty of users find editing configs in a text editor very friendly. Changing away from that would be LESS friendly to those users. Which users are most important to be friendly to?
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by kevin_thibedeau on Thursday August 11, 2022 @04:33PM (#32431359)
I find text configs very friendly up until the point that a package manager blows away my changes. This system harks from an era before fully automated software updates when a full time employed sysadmin was expected to manually oversee every single update. It's far easier to automate incremental changes to a binary database than to non-destructively modify a free form text file.
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by pxc on Friday August 12, 2022 @02:06AM (#32435152)
> I find text configs very friendly up until the point that a package manager blows away my changes.

Neither of these is a complete answer, but

1. Distros like NixOS and GuixSD address this successfully by emitting the config files themselves. They don't statefully edit your configs but instead store them in their own language and then translate them as wholes.

2. You can mitigate much of the pain of this with something like etckeeper, which essentially gives you version control for /etc.

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by stormking on Thursday August 11, 2022 @03:41PM (#32430766)
The problem here are UI designers who adore Apple but cannot afford a Macbook. So they target the Linux desktop.
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by thayne on Thursday August 11, 2022 @10:33PM (#32434167)
There's no reason you can't have both. KDE for example does a pretty good job of having GUIs to edit config, but that config is stored in human editable text files.
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by pessimizer on Thursday August 11, 2022 @04:07PM (#32431065)
> Unix will never to achieve true user-friendliness and wide adoption if we treat settings like this.

You're responding to complaints that settings done this way are user-hostile, opaque, and require a ton of insider knowledge to even find. So if the only goal is user-friendliness, we're moving away from it, not towards it.

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by Quekid5 on Thursday August 11, 2022 @02:59PM (#32430203)
That text file and your editor is two layers of abstraction (at least, because there's parsing involved, e.g. how to i specify timouts? sizes? Can I use "MiB", "s", "ms", etc?).

The thing we want to optimize for is "how easy is to change a setting". Firefox's "about:" seems like a reasonable approach for expert users.

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by pessimizer on Thursday August 11, 2022 @04:09PM (#32431086)
> how to i specify timouts? sizes? Can I use "MiB", "s", "ms", etc?

These issues neither disappear nor improve when you hide the settings in a mystery binary.

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by Quekid5 on Thursday August 11, 2022 @05:21PM (#32431863)
I agree, which is why I mentioned the "about:" thing.

It would be nice to have a base level of types that all programs could agree on.

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by nequo on Thursday August 11, 2022 @03:17PM (#32430433)
But the abstraction that is the text editor is shared across many programs. You can use your favorite text editor to edit any of the plain-text configs that you need. Firefox’s about: and the way to edit it are specific to Firefox.
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by Quekid5 on Friday August 12, 2022 @06:46PM (#32444870)
Well, yes, but we were imagining a world with a sort of universal "about:", I think?

You wouldn't even need that many basic types to cover about 90%+ of the state space. Of course, there would be bonus points if applications could define their own types in a UI-meaningful way.

Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by amarshall on Thursday August 11, 2022 @03:29PM (#32430586)
Almost all of the things that get written to dconf settings are in some typical GUI preference window in whatever application. Firefox’s about:config can be somewhat controlled through a user.js file.
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by dainiusse on Thursday August 11, 2022 @03:37PM (#32430714)
IBM AIX has "sort of registry". There are some good things in AIX, but querying configurations is ugly as hell
Re:Dotfiles being hidden is a UNIXv2 mistake (2012) by grumple on Thursday August 11, 2022 @03:42PM (#32430779)
But it's really nice just being able to alter a regular text file for settings for whatever application you're dealing with.