-
Notifications
You must be signed in to change notification settings - Fork 468
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
feat: use xdg-user-dir
to infer desktop, downloads, and other directory
#2192
Comments
Do you mean finding a way to reference the return value of |
We could add one more optional field to the [icon]
dirs = [
{ name = "VIDEOS", type = "xdg", text = "some icon" },
] When parsing the config, if we hit any entry of In case of a clash, we always use the user's icon, so this should not be a breaking change. This is Linux-specific, so we'll probably like to scope it to Linux. |
This would mean that if the user's XDG download directory is Also, I don't think |
Maybe we can just make |
Yes, it does solve the problem for me, but people could also have it mapped to different names. Since a really neat interface already exists, I think we should make use of it. |
If the user renames their download directory to |
Or if |
Hmm, I still do not wholly agree with that. I would prefer there to be a built-in inference, but it is fine. It's your project and a great one at that. So, I'll be happy with whatever you decide. Please feel free to close this and let me know if the path is going to be case-insensitive for icons. |
Closing as not planned, feel free to raise a PR if having For the future: If anyone else needs it, please file a new issue and propose a cross-platform and more reliable matching method (using full paths instead of just |
yazi --debug
outputPlease describe the problem you're trying to solve
Currently, the user directory icons are hardcoded at https://github.com/sxyazi/yazi/blob/main/yazi-config/preset/theme-dark.toml#L248.
Since I use lowercased XDG user directories personally, the icons do not apply for me.
Would you be willing to contribute this feature?
Describe the solution you'd like
It would be great if
yazi
could just infer the XDG directory paths usingxdg-user-dir
. There's a pre-existing crate for this:https://docs.rs/xdg-user/latest/xdg_user/
Additional context
No response
Checklist
The text was updated successfully, but these errors were encountered: