Minority Opinions

Not everyone can be mainstream, after all.

No more .*rc files, please

leave a comment »

My home directory is filled with junk.  Much of it was left there by some program used once, but some of it is useful configuration that I edit occasionally.  I just don’t want so much of it to be stuffed in hidden files within a single directory.  Increasingly, I find myself annoyed at all of the .<package> directories and particularly the .<package>rc files, with their odd pseudo-suffix.

How hard would it be to consolidate all of that junk into a single directory?  The old Macs I used to play with had a Preferences directory somewhere, but it probably applied system-wide.  Fortunately, I see hidden among the dot-junk in my home directory a gem named .config, containing (surprise) configuration information that (1) isn’t cluttering up my home directory, and (2) doesn’t start with a dot.  It’s all hidden by virtue of being in a single hidden directory, without requiring me to type -a every time I want to list it.

The real win here, though, is in graphical file browsers.  I currently have a choice between missing out on potentially important files, or wading through piles of junk to see the ones I really want.  When I’m looking for configuration files, that’s usually all I want to see, so having them in a single directory makes sense.  Otherwise, I don’t want to see them at all, so mixing them in with everything else in my home directory is just annoying.

On the other hand, I can see a case for the second collective directory on my system, .cache, for all of those auto-generated files that aren’t technically configuration, but stick around between program invocations.  Its primary purpose is caches, of course, but that should include the command histories, image thumbnails, and recently-used lists currently littering my home.  Cases could be made for lock files, timestamps, and logs, too; anything that the user isn’t expected to edit, particularly if you don’t care when it might disappear.

Within each of those two directories, though, I don’t want to see more than a single entry per package.  If your package can survive with a single configuration file, then I would like to see .config/<package>.cfg; maybe .ini if you’re using a compatible format, but *.cnf, *.conf, and particularly *rc look archaic and silly.  If you need more than one file, if it can import other user-defined files, or if your file doesn’t lend itself well to using your package name, then create a new <package> directory inside .config or .cache, and look for everything in there.

The question, then, is how to get to that point?  Some programs are set to check environment variables, like $LESSHISTFILE, but how many of those do I want to list in .profile?  For that matter, how do I get .profile to load from somewhere reasonable?  Worse, what about graphical programs, particularly those launched from the OS menu?  Will POSIX standards hinder the effort?

The harder (but ultimately more rewarding) route would involve editing the programs themselves to look in the new locations.  This would be particularly interesting for a new distribution, or perhaps for Gobo Linux.  There are two tricky parts: First, any program that can create such a file needs to check whether the directory exists, and potentially create it, before blindly attempting to write.  Two system calls and a branch, but it’s a bit more work for someone.  Second, fallbacks need to be made for users who already have something in the old place; .ssh in particular contains files that would be an absolute disaster to start ignoring.  I feel like it can be done, though.

Until then, who’s with me?  If you write or maintain software of your own, can I convince you to use .config/<package>.cfg instead of .<package>rc?  If you’re a user, does it bother you to see all the dotfile junk?  Or am I just being a neat freak with no standing in the Linux world?


Written by eswald

25 Feb 2010 at 1:42 pm

Posted in Linux

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s