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

Closed
opened 2021-06-29 07:33:05 +00:00 by dan · 3 comments
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 2021-06-29 07:33:05 +00:00
dan self-assigned this 2021-06-29 07:33:05 +00:00
dan added this to the Cwtch Beta 1.1 project 2021-06-29 07:33:05 +00:00

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).
Author
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 2021-07-12 20:09:35 +00:00
sarah added the
cwtch-beta-1.1
label 2021-07-13 17:47:59 +00:00
Author
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 2021-07-14 17:29:09 +00:00
Sign in to join this conversation.
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: cwtch.im/cwtch-ui#69
No description provided.