directories-rs icon indicating copy to clipboard operation
directories-rs copied to clipboard

Support global config directory in ProjectDirs

Open pheki opened this issue 2 years ago • 2 comments

Hi! It would be great if this library supported global config directories... My idea is:

Platform Value Example
Linux /etc/_project_path_ /etc/barapp
macOS /etc/_project_path_ or /usr/local/etc/_project_path_ (if installed via homebrew) /etc/barapp
Windows %ProgramData%\_project_path_\config C:\ProgramData\Bar App\config

MacOS implementation challenges:

  • Only the "bundle_id" is passed to project_dirs_from_path, which makes it hard to get the _project_path_.
  • How to detect if running through homebrew? Does homebrew patch repositories to change /etc/ to /usr/local/etc?

Another idea would be to use /Library/Application Support instead...

Kind of related to https://github.com/dirs-dev/directories-rs/issues/78

pheki avatar Jun 03 '23 05:06 pheki

One thing to add here is that the actual xdg spec uses XDG_CONFIG_DIRS which is /etc/xdg by default.

ModProg avatar Jun 30 '23 15:06 ModProg

These are all related: #87 #78 #58

andrewbaxter avatar Jul 19 '24 12:07 andrewbaxter