Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support XDG Base Directory Specification for dfminstall file #38

Open
erikw opened this issue Oct 28, 2021 · 0 comments
Open

Support XDG Base Directory Specification for dfminstall file #38

erikw opened this issue Oct 28, 2021 · 0 comments

Comments

@erikw
Copy link

erikw commented Oct 28, 2021

First of all, thanks for providing this dotfiles solution. I've used it already since at least 2012 according to my git history, and it has worked flawlessly throughout all the years!

Background

Lately the XDG Base Directory Specification has been gaining quite a steady popularity, even though it's been around for a long time already. The basic idea is to standardize where programs put their files e.g. all config files in a certain directory. The benefits for end users are many, including:

  • No polluted $HOME/
  • Can easily grep for only config files in $XDG_CONFIG_HOME
  • Can decide where to store configurations in more complex setups (multi system setup e.g.)
  • Easily wipe state by removing $XDG_STATE_HOME or even $XDG_DATA_HOME, but without destorying and configuration files.

The first point is maybe what most end users enjoy the most though.

How

As this project is the one actually setting up dotfiles, this subject becomes a bit meta. But basically the goal is the following: dfm should support looking at

  • $source_dir/.config/dfm/install or fallback to current
  • $source_dir/.dfminstall

By allowing the placement of the install file in .config/dfm/, this file will be able to be found (after dfm install) in the default XDG config directory where configuration files should be.

In my own dotfiles repo, I did a PoC erikw/dotfiles@0a0230c and it seems to a rather isolated change. It's just a matter of modifying the 3 identical lines

my $dfm_install = _load_dfminstall("$source_dir/.dfminstall");

to check if $source_dir/.config/dfm/install exist first and use that if found.

So most people will have XDG_CONFIG_DIR being the default value $HOME/.config. But what about if someone actually have set a non-default value; how would .config/dfm/install related to that? I was figuring in that case, this person can in their dotfiles repo do git mv .config/dfm/install .custom-non-default-config-path/dfm/install.

Edit.

~/.backup should probably live in $XDG_DATA_HOME/dfm/backup

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant