Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Checkout XDG Base Directory Specifications #30

Open
ronald-jaepel opened this issue Dec 18, 2023 · 1 comment
Open

Checkout XDG Base Directory Specifications #30

ronald-jaepel opened this issue Dec 18, 2023 · 1 comment

Comments

@ronald-jaepel
Copy link
Contributor

In GitLab by @j.schmoelder on Dec 18, 2023, 11:40

For the location of configuration files, temporary files, caches etc, checkout the XDG Base Directory Specification.
This specification defines where these files should be looked for by defining one or more base directories relative to which files should be located.

Basics

The XDG Base Directory Specification is based on the following concepts:

  • There is a single base directory relative to which user-specific data files should be written. This directory is defined by the environment variable $XDG_DATA_HOME.
  • There is a single base directory relative to which user-specific configuration files should be written. This directory is defined by the environment variable $XDG_CONFIG_HOME.
  • There is a single base directory relative to which user-specific state data should be written. This directory is defined by the environment variable $XDG_STATE_HOME.
  • There is a single base directory relative to which user-specific executable files may be written.
  • There is a set of preference ordered base directories relative to which data files should be searched. This set of directories is defined by the environment variable $XDG_DATA_DIRS.
  • There is a set of preference ordered base directories relative to which configuration files should be searched. This set of directories is defined by the environment variable $XDG_CONFIG_DIRS.
  • There is a single base directory relative to which user-specific non-essential (cached) data should be written. This directory is defined by the environment variable $XDG_CACHE_HOME.
  • There is a single base directory relative to which user-specific runtime files and other file objects should be placed. This directory is defined by the environment variable $XDG_RUNTIME_DIR.

All paths set in these environment variables must be absolute. If an implementation encounters a relative path in any of these variables it should consider the path invalid and ignore it.

There's also a Python library that might come in handy: https://pyxdg.readthedocs.io/en/latest/basedirectory.html

@ronald-jaepel
Copy link
Contributor Author

In GitLab by @r.jaepel on Dec 18, 2023, 15:51

Good idea, will look into it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant