Why do some applications use ~/.config/appname for their config data while others use ~/.appname

configurationdot-filesfreedesktophomeposix

I've noticed that some applications put their configuration files to ~/.config/appname while others use ~/.appname (the classic way, AFAIK) for this. What's the sense in this distinction and what could be better to consider for an application of mine?

UPDATE: Looks like my (XUbuntu 11.10 default) $XDG_CONFIG_HOME is set to ~/ and the most of the applications in my system (like Mozilla Firefox, Adobe Flash Player, Midnight Commander, Opera, Wine, etc.) comply to this. But there are still many applications (like Compiz, Deadbeef, VLC, Qt Creator, Google Chrome, XFCE, etc.) using ~/.config/ instead. Another suspicious thing is that directories in ~/.config/ are not themselves hidden (no dot in their names) – aren't application config dirs expected to have constant own names without depending on the location ($XDG_CONFIG_HOME value)?

Best Answer

A complement to jasonwryan's great answer, addressing some of your issues:

  • Your $XDG_CONFIG_HOME is not set to ~/. It simply isn't set. So applications that follow the XDG Specification use the default ~/.config

  • The dirs inside /.config are not hidden because they don't have to. The whole point of using a ~/.config dir is to un-clutter the user's $HOME. Since they are already in a separate, hidden dir, there's no need to be hidden inside there.

  • Software that does not follow the spec (unfortunately still the vast majority) use a hidden dir for their settings (like ~/.myapp) as an attempt not to clutter the user's $HOME. It (kinda) works, but it is still a bad approach when, for example, you try to backup your settings and your "big data" (like Pictures, Videos, Music) separately. Having all settings in a single place, without mixing with user's data, is a much better approach

  • As for "having constant names regardless of where XDG_CONFIG_HOME points to" , they already do: it is appname without the leading dot. Remember: the ones using $HOME/.appname are the ones that ignore XDG Spec. They use a hardcoded path.

  • As for your applications, please use the XDG Standard! I beg you, and your users will thank you for not cluttering their home directory any further.