I need to add a config file to tracker. Debating myself a bit on what the location should be. For the data files, I am currently using a crate called "directories" which helps locate OS-dictated standard directories for such things.

But it's a bit annoying to have things in ~/Library/Application Support/tech.skagedal.tracker – following the macOS standard, rather then just ~/.tracker, or following the XDG standard ~/.config/tracker which seems to be quite common also on macOS for CLI apps.

Long thread here: https://github.com/dirs-dev/directories-rs/issues/47

Seems they won't support that.

Support for using ~/.config on Mac for command line apps · Issue #47 · dirs-dev/directories-rs

While not the official Apple sanctioned place for config files, the standard on the command line for MacOS tends to be using the Linux style ~/.config for config files. Can we add support for using...

GitHub

I think I'll use this crate instead: https://crates.io/crates/etcetera

It's what `bat` uses. It follows the XDG standard everywhere except Windows.

I feel that this makes a lot of sense for CLI config files which the user is supposed to edit themselves. As someone pointed out in the thread above, Apple's default locations are more for files that are not supposed to be edited directly by the user.

crates.io: Rust Package Registry