twelf
twelf copied to clipboard
Add XDG basedir layer
It would be cool for applications to support the XDG basedir spec effortlessly. This can be done by:
- Creating a layer to
${XDG_CONFIG_HOME:-$HOME/.config}/<application name>/<config file>
. - Creating a layer for each path in
${XDG_CONFIG_DIRS:-/etc/xdg}/<application name>/<config file>
I think this can be implemented by having a utility function that does all the work (given some configuration parameters) and then returns a Vec
(or an Iterator
) of layers.
There's an XDG crate out there that could be used, so this crate doesn't have to concern itself with the spec: https://whitequark.github.io/rust-xdg/xdg/struct.BaseDirectories.html