The Power of the XDG Base Directory Specification (2019)

by bfmon 6/7/2022, 7:58 PMwith 1 comments

by bfmon 6/7/2022, 8:27 PM

How prevalent is XDG? The only place I have seen it used is on [Caddy's Dockerfile].

The defaults do not seem to match what the [Filesystem Hierarchy Standard] is proposing, but they do seem reasonable:

    # user data (/usr/share)
    XDG_DATA_HOME="${XDG_DATA_HOME:-$HOME/.local/share}"
    # config files (/etc)
    XDG_CONFIG_HOME="${XDG_CONFIG_HOME:-$HOME/.config}"
    # cache files (/usr/share)
    XDG_CACHE_HOME="${XDG_CACHE_HOME:-$HOME/.cache}"
    # state files (/var/lib)
    XDG_STATE_HOME="${XDG_STATE_HOME:-$HOME/.local/state}"

  [Caddy's Dockerfile]: https://github.com/caddyserver/caddy-docker/blob/master/Dockerfile.tmpl#L40
  [Filesystem Hierarchy Standard]: https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard