Take the 2-minute tour ×
Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems.. It's 100% free, no registration required.

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)?

share|improve this question
add comment

2 Answers 2

Because those applications that place configuration files in $HOME are ignoring the XDG Base Directory Specification, notably:

There is a single base directory relative to which user-specific configuration files should be written. This directory is defined by the environment variable $XDG_CONFIG_HOME...

If $XDG_CONFIG_HOME is either not set or empty, a default equal to $HOME/.config should be used.
share|improve this answer
    
Looks like my (XUbuntu 11.10 default) $XDG_CONFIG_HOME is set to ~/, but there are still many applications using ~/.config/ –  Ivan Nov 11 '11 at 1:54
add comment

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 Speciifcation 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 say thanks for you not cluttering their $HOME any further.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.