Use XDG dirs for config data (eg. ~/.config/cwtch/ instead of ~/.cwtch) #69

Closed
opened 11 months ago by dan · 3 comments
dan commented 11 months ago
Owner

From a beta tester:

Please use the XDG base dir spec for application data: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

eg. ~/.config/cwtch/, ~/.local/share/cwtch/, instead of ~/.cwtch/ 

From a beta tester: Please use the XDG base dir spec for application data: https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html  eg. ~/.config/cwtch/, ~/.local/share/cwtch/, instead of ~/.cwtch/ 
dan added the
enhancement
linux
labels 11 months ago
dan self-assigned this 11 months ago
dan added this to the Cwtch Beta 1.1 project 11 months ago

For cross-platform compatibility, https://golang.org/pkg/os/#UserConfigDir would be the API for this. See also https://github.com/golang/go/issues/29960 for the discussions re: specific paths on macOS and Windows that led to UserConfigDir.

As a side-note, version 3 of the dirs Rust crate is consistent with the Go UserConfigDir across all platforms (versions prior to that differed on macOS).

For cross-platform compatibility, https://golang.org/pkg/os/#UserConfigDir would be the API for this. See also https://github.com/golang/go/issues/29960 for the discussions re: specific paths on macOS and Windows that led to `UserConfigDir`. As a side-note, version 3 of the `dirs` Rust crate is consistent with the Go `UserConfigDir` across all platforms (versions prior to that differed on macOS).
Poster
Owner

for now we seem to be putting a pin in this. After some internal team discussion we view core cwtch data like keys etc don't just belong to this specific instance of a UI but to the cwtch platform and future suite of tools. As such we think its data is more inline with ssh and gpg which both have .ssh and .gpg dirs in the home directory.

however it looks like many apps do take an env var to control their config directory so as a compromise we could work to having the ui respect that

https://superuser.com/questions/874901/what-are-the-step-to-move-all-your-dotfiles-into-xdg-directories

will start work on :)

for now we seem to be putting a pin in this. After some internal team discussion we view core cwtch data like keys etc don't just belong to this specific instance of a UI but to the cwtch platform and future suite of tools. As such we think its data is more inline with ssh and gpg which both have .ssh and .gpg dirs in the home directory. however it looks like many apps do take an env var to control their config directory so as a compromise we could work to having the ui respect that https://superuser.com/questions/874901/what-are-the-step-to-move-all-your-dotfiles-into-xdg-directories will start work on :)
dan added the
in-nightly
label 11 months ago
sarah added the
cwtch-beta-1.1
label 11 months ago
Poster
Owner

Cwtch now looks for and will use a CWTCH_HOME environment variable that can be used to specify your location of choice :)

Cwtch now looks for and will use a `CWTCH_HOME` environment variable that can be used to specify your location of choice :)
dan closed this issue 11 months ago
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date

No due date set.

Dependencies

This issue currently doesn't have any dependencies.

Loading…
There is no content yet.