-
Notifications
You must be signed in to change notification settings - Fork 23
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
Expose XDG conventions on macOS #45
Comments
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
I marked the two comments above as resolved since they didn't discuss this issue. Thanks for opening this issue. I've away from my computer for a while. I'm sorry for the late response here. About exposing the XDG conventions on macOS, I think the same could apply to Windows. I have some questions to ask:
|
Is this really a concern? If you want to follow xdg on systems which don't care for it, why not just use the xdg crate? It does xdg everywhere and specifically and wilfully only that. |
It's often a concern for users - search 'mac xdg' in some projects' issue trackers and you'll find plenty of spirited debate. Mostly I've found that even when the maintainers really want ~/Library/Application\ Support/appname/Resources/MacOS or whatever it is, they're willing to settle for respecting I don't think there's a good reason to object to that, the best is perhaps complexity, not wanting to take on the additional code path; but the way to solve that is to push it up into projects like |
I'm a user of several projects using |
I've had a brief conversation with @Dylan-DPC who is one of the owners & I think he is on board with addressing this issue. I hope we can move past the why & move forward with discussing the how of this problem. If you're not convinced that it is an issue, please read this once: dirs-dev/directories-rs#47 (comment). If you use macOS & don't agree with my reasoning (or the plethora of other issues linked in my comment), please feel free to share them. On to the solutions: I think that leaves us with 2 options:
I think it would be great if we could offer both solutions to the developers & have 3 modules: What are your thoughts @tesuji @Dylan-DPC? |
What about keeping the API the same and using a build tag/target to enforce XDG conventions? (IDK Rust, so forgive me if that's a stupid suggestion.) As I see it, on macOS it's basically a problem of UNIX programs not following UNIX conventions. 99% of the time, the library can do the right thing by knowing whether it's being used in a desktop application or a command-line one. |
That could work. I just think some crates might want to have access to both the XDG directories & the native directories (for fallback or migration purposes), so I didn't suggest that. I've found the |
Hi there, and thank you for this crate.
macOS is in the weird position of having its own conventions for Mac apps, but also being a UNIX system. A lot of programs developers install aren’t exclusively Mac programs, but also work on Linux, BSDs, etc.
For example, the fish shell, mpv, spotify-tui, GitHub’s “hub”, and the kitty terminal are a few I use personally on Linux and Mac. On both OSes they all put their config files in the same place:
~/.config
.Meanwhile, the
~/Library/Application Support
directory on my Mac seems to be exclusively used by native Mac applications. Applications that I would launch through the GUI, and which aren’t in my$PATH
.It would be great if this crate made the XDG conventions available on Macs too, so developers using this crate have the option of which to use. I have a silly little Gopher client, phetch, that runs on Linux and Mac. It uses
~/.config/phetch
, which plays nicely with the tools I listed above and is convenient for version control, discovery, etc. I’m not able to use this crate, because on Mac the config dir would be~/Library/Application Support/phetch
.I’ve also run into this while contributing to the Blightmud MUD client, which initially kept its config in
~/Library/Application Support/blightmud
. In that case, your config files are mostly Lua scripts - code that you want to add to or change regularly - and the application isn’t specific to macOS. We eventually switched to~/.config/blightmud
so it’s the same on *nix and Mac, but we couldn’t find a way to make that change while continuing to usedirs-next
.If the option of which to use were made available to developers, I imagine the thought process would go something like: If you’re building a native Mac application that’ll live in
/Applications
and has a GUI, you use the Apple guidelines (like~/Library/Application Support
). However, if you’re building a UNIX application that isn’t specific to Mac, you could use the XDG conventions.While my request may seem to go against the Standard Directories guidelines that Apple provides, I think it’s actually true to the guidelines because of the first entry:
In other words, I believe that the guidelines are for native Mac applications that live in
/Applications
. Random UNIX utilities likeytop
andbandwhich
andmpv
don’t need to follow these guidelines, and in fact it adds a bit of friction when they do. It would be great if they could also make use of this crate.Thank you!
The text was updated successfully, but these errors were encountered: