Skip to content

Added XDG support#57

Open
glymphie wants to merge 4 commits into
contabo:mainfrom
glymphie:xdg
Open

Added XDG support#57
glymphie wants to merge 4 commits into
contabo:mainfrom
glymphie:xdg

Conversation

@glymphie
Copy link
Copy Markdown

Summary

This PR updates the default configuration and cache paths to follow the XDG Base Directory specification.

Changes

  • Config file location

    • New default: $XDG_CONFIG_HOME/cntb/.cntb.yaml (if $XDG_CONFIG_HOME is set)
    • Falls back to $HOME/.cntb.yaml for backwards compatibility
  • Cache / token storage

    • New default: $XDG_CACHE_HOME/cntb/
    • Falls back to $HOME/.cache/cntb/ if $XDG_CACHE_HOME is not set

Notes

  • Existing users with $HOME/.cntb.yaml will continue to work without any changes

Related

Closes #39

glymphie added 4 commits April 8, 2026 16:16
Added a new default for where the .cntb.yaml lives.
New default is `$XDG_CONFIG_HOME/cntb/.cntb.yaml`, with backwards support
for `$HOME/.cntb.yaml` files.
Added XDG support for how the `token` is stored in cache.
New default is `$XDG_CACHE_HOME/cntb/token`.
Which resolves to `$HOME/.cache/cntb/token` if `$XDG_CACHE_HOME` isn't
declared.
Clarified how the xdg default works.
Corrected help text to reflect xdg support:
The first checked config is `$XDG_CONFIG_HOME/cntb/.cntb.yaml`.
@glymphie glymphie mentioned this pull request Apr 12, 2026
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

Successfully merging this pull request may close these issues.

Add XDG support

1 participant