Hacker News new | ask | show | jobs
by godelski 648 days ago
I think I'm doing my dotfiles wrong.

In my dotfiles I have a couple folders which includes rcfiles and configs. rcfiles includes things like {bash,zsh}rc, .vim{,rc}, tmux.conf, and so on, as well as folders like zsh that include things I import like aliases I have for specific linux machines (e.g. ubuntu has batcat instead of bat...) or osx. Then in config I have folders that contains all the things I would have under ~/.config (starship.toml, ipython_config.py, wezterm/<only lunatics have a single config if you have more than 50 total lines>, and so on. Then I just

  $ find "${DOTFILES_DIR%/}"/rc_files ! -name "README.md" ! -name "*root" -depth 1 -exec bash -c  'ln -sf "${0}" "${HOME%/}"/."${0##*/}"' {} \;
  $ ln -sf "${DOTFILES_DIR5/}"/configs/* "${HOME%/}/.configs/"
I mean I have other folders too like scripts, skels, templates, systemd configs, notes (notes in dotfiles is underappreciated!), and so on. What are you all using these managers for? Are they replacements for bash scripting? And also, find is super powerful and I think under appreciated. It really is worth learning. If you jump into the deepend I think you can get good at it in an afternoon.
1 comments

> I think I'm doing my dotfiles wrong.

The problem isn't you. It's the way Unix-inspired systems do things that are entirely wrong. It's an insane mess of all of the things you mentioned because all the programs could do whatever they wanted. Bad conventions emerged and were propagated throughout the ecosystem.

Here's a fun exercise: try to change your home directory's physical location on a *nix system and see if anything works afterwards. It won't because every config thinks your files are in /home/me while you've changed your user name/home directory to /home/new-me. Windows (eventually) actually got this (approximately) right with a 'virtual directory' for 'my home directory' regardless of where exactly it is on disk. Programs refer to that virtual location.

The current status quo on any *nix is absurd.

(Just FTR, I only use Linux systems, personally. My criticism is borne from a place of aspiration/hope.)

I've done this and it almost worked, ha ha, except for all the paths that don't use $HOME
Yeah I've never really had a problem either. Even with using skels.

Besides, install scripts are the norm for me, so it's typically easy to fix when things do go wrong.

Pro tip: "${HOME%/}/" will always result in /home/godelski even if I include my last name and even if I accidentally modified it to have a / at the end. Some simply variable substitutions go a long way.