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 use dotin to organize this into two folders inside ~/dotfiles:
~/dotfiles/
├── zsh/
│ └── ...
└── polybar/
└── ...To import the files into the ~/dotfiles/ we must provide the group name, the given files will go into ~/dotfiles/GROUP/:
dotin import zsh .zprofile
dotin import zsh .zshrc
# or
dotin import zsh .zprofile .zshrcIf they don't exist, dotin will create both ~/dotfiles/ and ~/dotfiles/zsh/ before importing the files.
Here is the current ~/dotfiles structure:
~/dotfiles/
└── zsh/
├── .zprofile
└── .zshrcWe moved the files, but zsh still works like before because dotin created symlinks back at their original location:
~
├── .zprofile -> ~/dotfiles/zsh/.zprofile
└── .zshrc -> ~/dotfiles/zsh/.zshrcBecause we use symlinks, if you edit ~/.zprofile or ~/.zshrc, your editor will edit the real file inside ~/dotfiles/zsh/.
Now, 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.shBy organizing the files in this structure, dotin knows what their original location was.
With all configs inside the ~/dotfiles folder, now we can turn it into a repository using git:
# 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 HEADDone, your configs are backed up.
Requirements: dotin and git:
git clone <REPOSITORY_URL>
dotin link zsh
dotin link polybarDone, files are linked to the correct locations (conflicts are reported, if any).
Alternatively, you can link using stow instead of dotin:
# stow is more widely available
sudo apt install stow
# `stow` requires you to either be inside the folder or provide flags
cd ~/dotfiles
# same as `dotin link polybar`
stow 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 unusual 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.