ulif / diceware

Passphrases to remember
GNU General Public License v3.0
354 stars 45 forks source link

Support for XDG_CONFIG_HOME variable #86

Closed kmille closed 1 month ago

kmille commented 2 years ago

Hey, it's cool to have config file support at ~/.diceware.ini. But it's uncool to have the home directory full of .dotfiles. Can you please honor the XDG_CONFIG_HOME envrionment variable? It's documented here: https://wiki.archlinux.org/title/XDG_Base_Directory https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html

The idea is: if XDG_CONFIG_HOME is set, use it as base dir to look for the config file. If there is no config file, use the default location at ~.

ulif commented 2 years ago

Sounds reasonable. I will have a look into that next week. Do Windows / Mac support that pattern as well?

kmille commented 2 years ago

I couldn't find that much information. It seems like it's a feature only used by Linux. Maybe a good resource is this: https://github.com/adrg/xdg/blob/master/README.md Qutoe:

On Windows, XDG environment variables are usually not set. If that is the case, the package relies on the appropriate Known Folders. Sensible fallback locations are used for the folders which are not set.