Saturday, March 14, 2009

Are XDG Folders Important?

I've written about the XDG specs several times before (and had debates over them). The most conspicuous XDG folders are the ones in your Places menu -- Documents, Pictures, Videos, etc. (possibly localized for you by xdg-user-dirs) -- but they aren't the only ones the XDG specification covers. Application information like data, cache, and configuration is also covered. Ploum writes:
Your application should not have its own folder anymore (and should not use another software hidden folder like .gnome2).
User data should go into $XDG_DATA_HOME (which default to .local/share), user preferences should go into $XDG_CONFIG_HOME (which default to .config) and cached data should go to $XDG_CACHE_HOME (which default to .cache).
Of course, there's no need to read the environment variable yourself : most language provide a library to use XDG folder. For example a patch for a GTK application or one for a python application.
-- Modify your application to use XDG folders - Where is Ploum ?

There's a nice discussion at the linked blog. I disagree with some posters' view that XDG goes against Unix history. I think the spec is well though-out and helps everyone know where to find stuff, which is difficult with a bunch of dot files and directories in $HOME. Is Rhythmbox config in .rhythmbox? No, it's in .gnome2/rhythmbox. Ugh. If you are interested in the details of this spec and how it's evolving, you should  join Freedesktop.org's XDG mailing list.




Reblog this post [with Zemanta]

2 comments:

  1. My home folder has survived for 3 or 4 years. I have thousands of .something files in my home folder, and its really annoying. Many of them are garbage that the uninstaller should have deleted when I removed the applications. Yet, a lot of them have key important system preferences.

    It's not always a problem because the file browser hides them, but a lot of poorly coded applications (filezilla for example) display my hidden folders in the file browse view! If all my hidden folders were under .local it wouldn't be a problem.

    ReplyDelete
  2. Hey,

    Could you please update the link to http://ploum.net/post/207-modify-your-application-to-use-xdg-folders ?

    Thanks !

    ReplyDelete

Other I' Been to Ubuntu Stories

Related Posts with Thumbnails