ubnt-intrepid / dot

Yet another management tool for dotfiles
MIT License
227 stars 11 forks source link

Use XDG directories #15

Closed KokaKiwi closed 4 years ago

KokaKiwi commented 4 years ago

dot config files are actually stored in $HOME/.dotfiles, which is not xdg-base-directories compliant. Not that it's a requirement, but this spec allows config/data/cache files to have a consistent common place, which would be good to have to dot too. Also, there's already multiple Rust libraries to simplify handling this spec, like appdirs (which even supports multiple platforms!)

I can try making a PR if this OK to move from $HOME/.dotfiles to $XDG_CONFIG_HOME/dotfiles

PS: Yes, i know about the DOT_DIR env var, but i simply think following XDG specs for directories should be the default.

ubnt-intrepid commented 4 years ago

The reason why .mappings is located at the repository root and does not conform the XDG specification is to clarify that the mappings does not control the behavior of the dot command, and the contents are strongly linke to the .dotfiles repository itself. There are few advantages to placing the mapping file outside the .dotfiles repository, and additional steps are required to manage its symbolic link. Therefore, there is no plan to replace the location of mapping files with XDG directories (at least for now).

If you would like to link the mapping file itself to the XDG configuration directory, try to add entries to your .mappings as follows:

[general]
".mappings" = "~/.config/dot/mappings"

(It might be a good idea to expose the environment variables such as XDG_CONFIG_DIR in .mappings.)