The XDG Base Directory Specification provides guidelines for where applications should look for configuration files, data files, and cache files in a user's environment. This specification aims to improve the organization of user files and reduce clutter in the user's home directory.
- Base Directories: The specification defines several base directories that applications should use:
- $XDG_CONFIG_HOME: This is the directory where user-specific configuration files should be stored. If this variable is not set, the default is
~/.config
. - $XDG_DATA_HOME: This directory is for user-specific data files, defaulting to
~/.local/share
if not set. - $XDG_CACHE_HOME: This is where user-specific non-essential data files (cache) should be stored, defaulting to
~/.cache
.
- $XDG_CONFIG_HOME: This is the directory where user-specific configuration files should be stored. If this variable is not set, the default is
- $XDG_STATE_HOME defines the base directory relative to which user-specific state files should be stored. If $XDG_STATE_HOME is either not set or empty, a def