4 ms·
One way to make your config files more visible: mv "$HOME/.config" "$HOME/config" ln -sfn "$HOME/config" "$HOME/.config" If you want to move and link
by jph 4y ago
One way to make your config files more visible:
mv "$HOME/.config" "$HOME/config"
ln -sfn "$HOME/config" "$HOME/.config"
If you want to move and link files that you want to make visible:
mv "$HOME/.foo" "$HOME/config/foo"
ln -sfn "$HOME/config/foo" "$HOME/.foo"
If you want, you can set a custom location in your system file `/etc/profile` or your user file `~/.profile`, or `~/.bashrc` or `~/.zshenv` etc.
export XDG_CONFIG_HOME="$HOME/config"
Helpful links for XDG:
https://specifications.freedesktop.org/basedir-spec/basedir-spec-latest.html https://specifications.freedesktop.org/basedir-spec/basedir-...
https://wiki.archlinux.org/title/XDG_user_directories https://wiki.archlinux.org/title/XDG_user_directories
- bmurphy1976 4y agoWhy move the folder? Why not just symlink config to .config? There's almost certainly some poorly written tools out there that will blow up on the symlink. Why take that risk?
- cafeinux 4y agoFrom a purely esthetic point of view, if you're using a graphical file manager, the symbolic link might be denoted by an ugly icon. Surely there's a solution to that, but that's the only reason I could find.
- jph 4y agoYou're correct, moving the folder can expose a poorly written tool, meaning a tool that isn't following the symlink and isn't using XDG_CONFIG_HOME. To me, it's an advantage to surface the latent problems, so I can message the authors to ask them about updating. So far, all authors are good with updating. It turns out the bulk of the issues are in internal scripts that hardcoded ~/.config instead of using XDG_CONFIG_HOME. This is an easy fix, and at the same time we shellcheck those scripts.
- andrewla 4y agoI have a directory under ~/config, ~/config/dotfiles, that just has files that are intended to be dot-prefixed and linked in the home directory. That avoids any accidental over-linking; I can just run a script that links ~/config/dotfiles/$X to ~/.$X and I'm done.