known-folders icon indicating copy to clipboard operation
known-folders copied to clipboard

Detect the XDG runtime setting in env instead of configuration (on macOS)

Open nanozuki opened this issue 4 years ago • 4 comments

For some compatibility reasons, I set my own XDG Base Directories. Not equal to default macOS folder suggestions. I know there is a configuration to open XDG support on Mac, but some zig tools (such as zls ) don't provide a method to change it. If known-folders can read env and follow the XDG settings, will resolve this problem.

nanozuki avatar May 08 '21 09:05 nanozuki

Make an issue on their repository to enable XDG on mac. They only have to add this to their root file:

pub const known_folders_config = .{ .xdg_on_mac = true };

ikskuh avatar May 08 '21 09:05 ikskuh

Indeed this is a method. But I think it's still necessary to detect env:

  • Give the choice to the end-user, not binary developers. Since one binary will be used by many users with different enviroments.
  • By detecting env variables, a user can opt-in XDG directory, and use other directories in macOS default.

nanozuki avatar May 08 '21 09:05 nanozuki