sayanarijit / xplr

A hackable, minimal, fast TUI file explorer
https://xplr.dev
MIT License
4.08k stars 74 forks source link

Config file XDG conformance #627

Closed SolitudeSF closed 1 year ago

SolitudeSF commented 1 year ago

Config directory should default to $XDG_CONFIG_HOME/xplr with fallback to $HOME/.config/xplr.

sayanarijit commented 1 year ago

This would be a huge breaking change. As far as my preference goes, ~/. config is the way to go for all CLI/TUI based tools, both on linux and bsd, including mac. Could you pls confirm the OS you're using so that I can dig deeper into the issue?

SolitudeSF commented 1 year ago

linux. it would only be breaking for people who define XDG_CONFIG_HOME yet for some reason arent annoyed to hell when a program ignores it.

sayanarijit commented 1 year ago

Sold. Can you pls create a fix?

sayanarijit commented 1 year ago

@noahmayr said:


From what I understand this will break on MacOS. The dirs crate will give you MacOS specific paths like ~/Library/Application Support/xplr. Even though I'm explicitly setting $XDG_CONFIG_HOME, the maintainers of the dirs and directories crates are actively refusing to honor an environment variable intentionally set by MacOS users due to what sounds like "Apple knows best and it's your own fault for choosing a such a locked down system". Meanwhile 99% of CLI programs use ~/.config/* on MacOS or at least respect the $XDG_CONFIG_HOME environment variable.

@sayanarijit can we please hold back on releasing this until previous default behavior has been restored? This will be especially painful for those wanting to sync their dotfiles.


sayanarijit commented 1 year ago

@noahmayr thanks for raising the concern.

I currently don't have access to a mac, so can't dig into it right now. But yes, I'm not releasing a new version without testing it on a mac.

noahmayr commented 1 year ago

I'll try to look into this in the next couple of days. I actually raised a similar issue for rusmux (rust based tmuxinator alternative) since their config files are stored at ~/Library/Application\ Support/org.Meir-Kriheli-\<mkriheli@gmail.com\>.rusmux/ on MacOS even with XDG_CONFIG_HOME set.

Ideally we can find a library like dirs that actually honors the users config.

sayanarijit commented 1 year ago

There's this library we can try: https://whitequark.github.io/rust-xdg/xdg/struct.BaseDirectories.html

sayanarijit commented 1 year ago

Closing this as fixed.