A Unix dotfiles manager inspired by, and compatible with stow.
dotin concentrates your configs in a ~/dotfiles folder in order to help with:
- Backup/version control your configs (use
git). - Easily re-apply configs in another installation/machine (run
dotin link). - Maintain changes in sync between machines (use
git).
You can roughly achieve what dotin does by creating a custom script with mv and ln -s commands, however, dotin has lots of checks for conflicts and corner cases, when possible, checks are done before any mutation is done, ensuring you don't end up with a partial update.
- Usage
- Importing the files
- Sync With GitHub
- Reapplying Configs In a New Machine
- Differences from
stow - Known limitations
- Alternatives
Say you were configuring polybar and zsh, and ended up creating these config files in your home:
~
├── .zprofile (new, zsh)
├── .zshrc (new, zsh)
└── .config/
└── polybar/ (new, polybar)
├── config.ini (new, polybar)
└── launch.sh (new, polybar)We'll explain how to use dotin to organize this into two folders inside ~/dotfiles:
~/dotfiles/
├── zsh/
│ └── ...
└── polybar/
└── ...The files will be organized into two groups, zsh and polybar.
To import, first pass the group name, then provide the files to be imported.
dotin import zsh .zprofile
dotin import zsh .zshrc
# or
dotin import zsh .zprofile .zshrcIf they don't exist already, dotin will create both folders ~/dotfiles/ and ~/dotfiles/zsh/, then move the files inside.
Here is what it looks like:
~/dotfiles/
└── zsh/
├── .zprofile
└── .zshrcEven though your files were moved, everything works like before because the files were sym-linked to their original location, here is what's in your HOME now.
~
├── .zprofile -> ~/dotfiles/zsh/.zprofile
└── .zshrc -> ~/dotfiles/zsh/.zshrcNow, let's do the same thing for polybar:
dotin import polybar .config/polybarSo now we get:
~/dotfiles/
├── zsh/
│ ├── .zprofile
│ └── .zshrc
└── polybar
└── .config/
└── polybar/
├── config.ini
└── launch.shLike before, it's all linked and working, now, if you try to edit the files at your home, you'll actually end up editing the files inside of ~/dotfiles.
With all configs living inside a single folder, we can easily turn it into a repository and back them up using git and GitHub:
# Just the usual GitHub repository setup
cd ~/dotfiles
git init
git commit -a -m "dotfiles repository setup"
# Now, inside of GitHub, create your repository without a README, and follow their instructions that look like these:
git remote add origin <REPOSITORY_URL>
git push -u origin HEADWith dotin installed, you can re-apply all configs:
git clone URL
cd dotfiles
dotin link zsh
dotin link polybarDone, files are linked to the correct locations (conflicts are reported, if any).
If you're in a hurry and don't want to install dotin, try using stow instead:
# Installation for Debian-based and Ubuntu-based
sudo apt install stow
# Installation for Arch-based
sudo pacman -S stow
# stow requires that you are inside your dotfiles (or, use some flag)
cd ~/dotfiles
stow polybar # same as `dotin link polybar`dotin uses the same tree structure as stow, they are compatible.
Both tools are still similar, dotin is under development and there is a lot to be done, for now, here is how dotin differs from stow:
dotinruns more checks before linking or moving.- Simpler and more intuitive usage.
- Better checks and error messages.
dotinfails when dealing with exoteric file types.
- Wrap
gitusage. - Encryption.
- Secrets management.
stow.- Recommended, but overall a worse experience for dotfiles (in my personal opinion).
- Make your entire
$HOMEa repository and.gitignoreeverything.- Good, edit
.gitignoreto add or remove files. - If you like the idea, read this.
- Good, edit
- Create your own script.
- You'll likely waste time and end with worse ahead-of-time checks on conflicts and weird corner cases.
- Go for it if it'll be fun.
- Use
dotbotinstead. - Use
mackupinstead. - Use
chezmoiinstead. - Use some other tool.
- Use some
git-wrapping tool.