garabik / grc

generic colouriser
http://kassiopeia.juls.savba.sk/~garabik/software/grc.html
Other
1.9k stars 162 forks source link

Support `XDG_CONFIG_HOME` for config file #247

Open slacksystem opened 2 months ago

slacksystem commented 2 months ago

The XDG Base Directory Specification is a widely used setup for applications to store their files. It allows for a clean home folder and a setup that is also supported by many notable open-source projects such as: git, gtk, fish, emacs, curl, dconf, nano, neovim, pylint, pip, poetry, ruby, systemd, tmux, vim, virtualbox, vlc, and many others.

Having the program first check for the config file in ${XDG_CONFIG_HOME}/grc/grc.conf if XDG_CONFIG_HOME is set (with a different name for the file grc.conf if you like), then in ~/.config/grc/grc.conf, and then in the other folders would help this program match expectations many users have for compatibility with this widely accepted specification. Or even checking ~/.grc first but including checks for the above files if ~/.grc is not found could still be supportive of this specification and (in my opinion) improve the project.

slacksystem commented 2 months ago

After looking at one of the closed PRs, it seems like maybe this was already implemented? If that is the case, all that is needed is an update to the README (and any other documentation that might need it) as currently the files it lists do not include those recommended by this spec. If updating the docs is all that is needed I'm happy to submit updates to the documentation in a PR.