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.
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.
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.
ReplyDeleteIt'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.
Hey,
ReplyDeleteCould you please update the link to http://ploum.net/post/207-modify-your-application-to-use-xdg-folders ?
Thanks !