twelf icon indicating copy to clipboard operation
twelf copied to clipboard

Add XDG basedir layer

Open piegamesde opened this issue 4 years ago • 1 comments

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.

piegamesde avatar Nov 14 '20 11:11 piegamesde

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

tnewman avatar Mar 13 '21 17:03 tnewman