user config: Support XDG Base Directory Specification or `$HOME/.{config,local}/` #27512

issue dongcarl opened this issue on April 21, 2023
  1. dongcarl commented at 4:32 PM on April 21, 2023: contributor

    The XDG Base Directory Specification has been around for a while and there seems to be growing support for it in various applications. This issue is to start discussion around if and how we should support it.

    If the project is interested in supporting it (or a subset of it), here's an example of what we could do for the config file:

    1. Check for config files in the following order (first hit is applied, warn if multiple found)
      1. -conf command line parameter
      2. $datadir/bitcoin.conf
      3. $XDG_CONFIG_HOME/.config/bitcoin/bitcoin.conf
      4. $HOME/.config/bitcoin/bitcoin.conf
      5. $HOME/.bitcoin/bitcoin/bitcoin.conf (current non-XDG directory)

    A question: should we use $XDG_DATA_HOME ($HOME/.local/share) or $XDG_STATE_HOME ($HOME/.local/state) for the datadir?

  2. fanquake commented at 4:42 PM on April 21, 2023: member

    Dupe of #16733?

  3. dongcarl commented at 5:13 PM on April 21, 2023: contributor

    True, will post what I wrote there and close.

  4. dongcarl closed this on Apr 21, 2023

  5. bitcoin locked this on Apr 20, 2024
Contributors

github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-05-01 03:14 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me