diceware icon indicating copy to clipboard operation
diceware copied to clipboard

Support for XDG_CONFIG_HOME variable

Open kmille opened this issue 3 years ago • 2 comments

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 ~.

kmille avatar Feb 09 '22 13:02 kmille

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

ulif avatar Feb 10 '22 02:02 ulif

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.

kmille avatar Feb 11 '22 08:02 kmille