Skip to content
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

Support XDG Base directory specification #261

Open
InSuperposition opened this issue Jun 14, 2024 · 4 comments
Open

Support XDG Base directory specification #261

InSuperposition opened this issue Jun 14, 2024 · 4 comments
Assignees
Labels
enhancement New feature or request

Comments

@InSuperposition
Copy link

Is your feature request related to a problem? Please describe.
To improve organization of files and consistency of file paths, support XDG Base directory variables
https://wiki.archlinux.org/title/XDG_Base_Directory

Describe the solution you'd like
Support the XDG_* variables as an alternative to using $HOME/.kftray on Linux and OS X. Perhaps it should be the default, if variables are set..

@hcavarsan hcavarsan self-assigned this Jun 14, 2024
@hcavarsan hcavarsan added the enhancement New feature or request label Jun 14, 2024
@hcavarsan
Copy link
Owner

hey @InSuperposition thx you for the suggestion, it makes sense.

its easy to implement something like that, and from what I have seen in the lib in this code: dirs-rs, it follows the XDG_* standard only for Linux.

do you use these variables on linux and osx? cuz on osx it will respect the $FOLDERID_ variable and in this case and might not have the desired effect in your case.

i can create a workaround to explicitly check for the XDG_ variables on Unix-based systems and use them even on osx....

wdyt?

@InSuperposition
Copy link
Author

Thanks for the information on dirs-rs. I use the XDG_* variables on osx, while this is not standard by convention, it helps my OCD of keeping an organized $HOME folder 😉

I have noticed many CLI tools (git) and terminal apps (alacritty, kitty) support the XDG_ vars on osx, however tools that use dirs-rs like starship use custom environment variables for config (and cache/state etc..):
export STARSHIP_CONFIG=$XDG_CONFIG_HOME/starship/config.toml.

After thinking it over, IMO, the safest approach might be to have a KFTRAY_CONFIG variable the user can set similar to starship. I can open a ticket in the dirs-rs repo and make the suggestion to add the XDG_* vars for osx to their code base and get feedback from the developers of that library, who have more insight regarding this feature.

@hcavarsan
Copy link
Owner

hcavarsan commented Jun 18, 2024

yeap, that makes sense. I will try to implement the logic and read the XDG_CONFIG_HOME variable without using the library (and fallback to $HOME). I think it's quite simple. I will look into this during this week and will update you here on the issue, so there's no need to open an issue on dirs-rs. thanks!

@InSuperposition
Copy link
Author

Thank you, I appreciate the effort you have put into kftray.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants