Closed into-the-v0id closed 9 months ago
Thanks for submitting this. Could you add a check whether $XDG_CONFIG_HOME
is actually $HOME/.config
and not add the directory a second time if so? I know that adding it twice basically has no effect, but it still seems like the wrong thing to do. Everything else looks good.
Sure thing - I've added an additional check to only add $HOME/.config/dinit.d/
to the default user service directories if it is not set already (through $XDG_CONFIG_HOME/dinit.d/
)
Merged, thanks!
Dinit's default user service directory is
$HOME/.config/dinit.d/
. It does not respect / comply with the XDG Base Directory Specification. This PR adds$XDG_CONFIG_HOME/dinit.d/
as an additional default user service directory (alongside$HOME/.config/dinit.d/
for backwards compatibility).When searching for service definition files as a user instance, the following cases are possible:
$XDG_CONFIG_HOME
is set -> only search$HOME/.config/dinit.d/
$XDG_CONFIG_HOME
is set to$HOME/.config
->$HOME/.config/dinit.d/
will be searched twice$XDG_CONFIG_HOME
is set to a custom directory -> search$XDG_CONFIG_HOME/dinit.d/
and then$HOME/.config/dinit.d/
As far as I can tell, this should provide full backwards compatibility: The
$HOME/.config/dinit.d/
directory is still always searched and it's unreasonable to assume that the user already has a custom$XDG_CONFIG_HOME
with adinit.d/
directory.Feel free to ask for any changes to this PR or to reject it :)
Fixes #222