Skip to content

[Feature Request] Use OS directory conventions #420

Description

@pricklythorn

Is your feature request related to a problem? Please describe.
On all platforms, tiddl's config is placed in ~/.tiddl by default, it would make more sense and align with platform conventions to place it in the OS specific directories, such as ~/.config or ~/AppData/Roaming.

Describe the solution you'd like
In tiddl/cli/const.py, there could be separate functions for getting the different types of directories, such as get_config_path() or get_cache_path(), all with a corresponding environment variable. For Linux, the XDG environment variables could be respected, the tiddl variables would take precedence over those.

Because the current directory used is ~/.tiddl, this change could only be for new users, or explicitly opted into (the CLI could move the files to the new locations).

Describe alternatives you've considered
Can't come up with any.

Additional context
These are the directories on each platform

  • Linux:
    • Config: XDG_CONFIG_HOME, then ~/.config
    • Data: XDG_DATA_HOME, then ~/.local/share
    • State: XDG_STATE_HOME, then ~/.local/state
    • Cache: XDG_CACHE_HOME, then ~/.cache
  • macOS:
    • Config, data, and state: ~/Library/Application Support
    • Cache: ~/Library/Caches
  • Windows:
    • Config, data, and state: ~/AppData/Roaming
    • Cache: ~/AppData/Local

Metadata

Metadata

Assignees

Labels

new featureFeature that is not implemented yet

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions