Add support for the XDG Base Directory specification #441
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Motivation
(just in case you are not aware of the spec...)
The XDG Base Directory specification is a wider effort in the Linux community to standarize where applications place their relevant files (whether they are configuration / cache related etc). This helps in decluttering their home folder but also makes tracking their configuration files more easily using their version control system of their choice.
For more please read: https://wiki.archlinux.org/title/XDG_Base_Directory
Proposal
I took inspiration from this recently closed PR and improved upon some areas (mainly addressed the comment that was raised there).
What I am proposing is this:
~/.tcc/
directory then use that. This keeps backwards compatibility.XDG_CONFIG_HOME
environment variable set use$XDG_CONFIG_HOME/tuxedo-control-center/
as the configuration directory.~/.config/tuxedo-control-center/
I took the liberty of naming the directory
tuxedo-control-center
as I think it is more readable, but it is obviously up to you!Migration steps
XDG_CONFIG_HOME
or~/.config
) and just delete the~/.tcc
directory.Disclaimer
These changes have not been tested and my JS/TS knowledge is not amazing. That being said I did run these functions on a node instance so that I am at least sure they do what I think they do.