Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Oddly I feel completely the opposite about this topic. I think dot files in your home directory are exactly the way to go. Using the XDG standard leaves you with whatever the distro decides is the correct location for these files. While their recommendation is all in the home directory, I wouldn't put it past some of these distro developers to make some crazy /var/users/{uid}/config directory. This is important when setting up your partitions. I keep home and the system separate so that I can easily swap out the OS. Home should be the only location a user has write access.


> Using the XDG standard leaves you with whatever the distro decides is the correct location for these files.

This is not true. Even if the distribution sets global xdg variables (none that I've come across do) - the user can always override them.

> While their recommendation is all in the home directory, I wouldn't put it past some of these distro developers to make some crazy /var/users/{uid}/config directory

This sounds like a strawman. Are you aware of any existing distros doing this? Users don't have write access to system directories in the vast majority of distributions.


So rather than use a standard that allows you to override it simply by changing some environment variables, you think that hardcoding a specific path is a better solution?

Definitely a unix developer.


I agreed, right up until the unnecessary second paragraph!


I think dot files in home directory for configuration files are fine, especially if the user creates the files themself rather than the program created them (although sometimes a program may wish to create a user cache file, for example Free Hero Mesh creates a file ~/.heromeshsession by default but you can configure a different name if you wish; also some programs such as web browsers may store cookies and so on, although you should be allowed to reconfigure that, too). A program might also support a command-line switch and/or environment variable to override what file (in what directory) to use.

Requiring files in your home directory that do not have a dot at first (with a fixed name) is no good, though.


A user can override any environment variables set by a distro.


At my university I only have write permissions in my home folder so I prefer this too and I only need to backup my home directory as well.


The default locations of all the XDG directories are also in your home directory, so you've got a bit of a false dichotomy here.


Most of the XDG environment variables aren't set to anything.


You don't have permissions to create directories in your $HOME, or write files to them?


Yeah, when I got to this:

To those of you reading this: I beg you. Avoid creating files or directories of any kind in your user's $HOME directory in order to store your configuration or data.

My immediate response was pretty much "where the hell else should they put them then?"

What exactly else is the /home dir even for otherwise?

The purpose of home is for user-level persistent files. Giving it access to something else means giving random programs write access to some global part of the file tree, and I'd rather not allow that except when actually necessary. As it is I hate having stuff that manual installs in /opt, or the way too many programs on Ubuntu are configured to require sudo to work.

I'm actually totally on board with more stuff that installs entirely local only, especially if it's from outside the distro's package system. I don't like stuff mangling the global tree with no clear standardized path for removal and uninstallation. At least if it's in /home, I can just delete it myself without even needing to go sudo.

And the purpose of .dotfiles in /home is because it prevents those user configuration files and other such local data from cluttering your directory when doing a plain ls for regular user files.

This article just sounds like a misunderstanding of how the file tree is even supposed to work.


> My immediate response was pretty much "where the hell else should they put them then?"

He didn't mean to avoid $HOME as a whole. Just the root of the $HOME directory.

I too much prefer having programs write their config files to $HOME/.config/program-name instead of $HOME because it's less clutter and now I can think "ok, $HOME/.config is where all of my app's configuration is", instead of having a bunch of files littered in $HOME while other apps use $HOME/.config/file_name or $HOME/.app_name.

It bothers me that .pypirc exists in $HOME, rubygems credentials are in $HOME/.gem/credentials and Docker's credentials are in $HOME/.docker/config.json. That's 3 different location styles for an app's config file. They should all be in $HOME/.config/$app_name/relevant_file_name for whatever the config is for.


the author explicitly refer to the locations ~/.local/share and ~/.config in accordande to the XDG standard. That the request is not referring to the entire $HOME subtree is quite obvious.


I had the same reaction, but by the end I think their main gripe is placing them in the root of the user's home directory.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: