xdg
XDG Base Directory Specification helpers.
Returns fs.Path values for standard user directories, respecting environment
variable overrides per the
XDG spec.
Functions
cache_home() -> fs.Path
Returns the XDG user cache directory ($XDG_CACHE_HOME).
Falls back to ~/.cache if the variable is absent or empty.
config_dirs() -> Array[fs.Path]
Returns the system-wide XDG configuration search directories ($XDG_CONFIG_DIRS).
Falls back to [/etc/xdg] if the variable is absent or empty. Only absolute
paths are included.
config_home() -> fs.Path
Returns the XDG user configuration directory ($XDG_CONFIG_HOME).
Falls back to ~/.config if the variable is absent or empty.
data_dirs() -> Array[fs.Path]
Returns the system-wide XDG data search directories ($XDG_DATA_DIRS).
Falls back to [/usr/local/share, /usr/share] if the variable is absent or
empty. Only absolute paths are included.
data_home() -> fs.Path
Returns the XDG user data directory ($XDG_DATA_HOME).
Falls back to ~/.local/share if the variable is absent or empty.
runtime_dir() -> (fs.Path | nil)
Returns the XDG runtime directory ($XDG_RUNTIME_DIR), or nil if unset.
Intended for user-specific non-persistent runtime files such as sockets and named pipes. This directory may not exist on all systems.
state_home() -> fs.Path
Returns the XDG user state directory ($XDG_STATE_HOME).
Falls back to ~/.local/state if the variable is absent or empty.