Skip to content

Add support for the XDG Base Directory specification #441

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

loukwn
Copy link

@loukwn loukwn commented Jun 11, 2025

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:

  • If there is already a ~/.tcc/ directory then use that. This keeps backwards compatibility.
  • If not, then if there is an XDG_CONFIG_HOME environment variable set use $XDG_CONFIG_HOME/tuxedo-control-center/ as the configuration directory.
  • If there is no such environment variable then just use ~/.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

  • For users that do not care about this, nothing needs to be done
  • For users that care about this, they can just manually move the files to the place that they want (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.

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.

1 participant