Hacker Newsnew | past | comments | ask | show | jobs | submitlogin
XDG Base Directory Specification (alchemists.io)
5 points by xpe 81 days ago | hide | past | favorite | 2 comments


Here's a summary of XDG_STATE_HOME from [1]:

    The $XDG_STATE_HOME contains state data that should persist between
    (application) restarts, but that is not important or portable enough
    to the user that it should be stored in $XDG_DATA_HOME. It may contain:

    - actions history (logs, history, recently used files, …)

    - current state of the application that can be reused on a restart
      (view, layout, open files, undo history, …)
For example, I've seen history files end up in the wrong XDG directory such as XDG_CONFIG_HOME.

[1]: https://specifications.freedesktop.org/basedir-spec/latest/#...


I'm sharing the article out of pain as I try to add only the relevant files from ~/.config into version control. Many programs partially implement the XDG Base Directory spec by using ~/.config. But then some also dump data, cache, state, logs, and other non-configuration material into the same place. [1] The article above summarizes how XDG offers four different places:

    - Cache $HOME/.cache
    - Configuration $HOME/.config
    - Data $HOME/.local/share
    - State $HOME/.local/state
[1]: This is why we can't have nice things!




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

Search: