doot 📯
doot is a bash script (doot.sh) which doots your doot files into their respective doot
folders, for better doot portability and easier doot setup.
But why? Aren’t there already tools for that?
I’ve tried a couple alternatives to manage my dotfiles and while some of them are better than others, none of them really behaved the way I need. Some close calls over the years have been:
-
I used dotbot for some time, but between its dependency on Python, and having to maintain a YAML file which essentially just mirrored the folder structure already present in the files, I started disliking it.
-
GNU stow stores dotfiles in ‘packages’ which you’ll need to get your head around, and symlinks folders, which becomes an issue when you have to use applications that don’t respect the XDG Base Directory Specification, since these will fill up your otherwise neatly organised dotfiles with data and cache files. Case in point, my
$XDG_CONFIG_HOMEis currently sitting at around 500MB. No, I have not written 500MB worth of config files. -
I also tried using a bare git repository for a while, but realized it was a mess because I also maintain some system-wide config files owned by root across multiple devices. That had me doing a weird dance of using git as root, which I can’t say I found pleasant.
With the enumeration out of the way, I’d like to emphasize that all these are great tools in their own right and might suit your use-case perfectly. As with anything, make sure to test and check them out yourself before taking my word for it.
In any case, I sat down and wrote doot. Personally, I blame XKCD.
How to doot
tl;dr:
Clone the repository, add your doot files under user or root, run
./doot.sh and your doots will be copied/linked to their places. For the adventurous, there are also
some settings at the top of the script.
ts;mt (too short; more text):
-
Clone
dootto where you’d like to keep track of your doots (optionally, fork it first, for easier VCS later). For instance,git clone https://codeberg.org/cyberme0w/doot ~/.doot` -
Understand the difference between user-doots and root-doots:
-
user-doots are owned by the non-root user, and are placed in
~/.doot/user, which maps to the user’s$HOME. E.g.~/.doot/user/.config/mutt/muttrcmaps to$HOME/.config/mutt/muttrc -
root-doots are owned by root, and are placed in
~/.doot/root, which maps to/. E.g.~/.doot/root/etc/default/grubmaps to/etc/default/grub.
-
-
Copy your configuration files into their respective
~/.doot/folders and optionally track them with VCS (a fork of the repo works just fine). -
Double check the doot settings in the first lines of
~/.doot/doot.sh. These are pretty self explanatory, but for completeness sake:ASK_BEFORE_REM: prompt user before removing files (Can betrue/false. Defaulttrue)ASK_BEFORE_ADD: prompt user before adding files or folders (Can betrue/false. Defaultfalse)ADD_MODE: how to add doots to your system (Can becopy/linkto usecporln -sfrespectively. Default:link)USER_PATH: the path to the user-doots inside~/.doot(Can be any path. Default:user)ROOT_PATH: the path to the root-doots inside~/.doot(Can be any path. Default:root)ROOT_WITH_DOAS: some people prefer to usedoasinstead ofsudoto get an elevated shell (Can betrue/false. Default:false. Requiresdoas)RM_CMD: how to delete files (Can be any command that removes files. Default:rm -f)
-
Run
doot.shfrom within the dots folder and your files will be deployed.