Some time ago, I started to get annoyed at the bothersome task of copying configuration files between my desktop, laptop, and remote environments. First of all, copying the configs typically involved a lot of repetitive scp’s. The second annoyance is a little worse: some of my dotfiles need a few special settings that are localized to one environment (e.g. just to my server), but I can’t source some “local” config from the main one.
Of course, the answer was to come up with some ridiculous solution and today, I bring you:
dotman (aur package)
What on earth is it? It’s a way of managing configuration files across multiple environments. You can upload your configs to a remote repository and then download them from each of your environments. Furthermore, when you grab them from the remote area, you can do a diff against your existing file to keep your localized changes.
Right now, dotman only supports transfer via SFTP (through Paramiko), but it’s possible to add more protocols later. The code is still a bit messy and needs some rewriting to properly handle exceptions, but as it stands, you can do quite a bit. Take a look at the instructions on the above page to see how things work.
I’ve seen several different solutions to this kind of problem: some people use rsync and others use revision control systems. I considered trying these out, but my “if you want something done right, do it yourself” mentality took hold and wouldn’t let go. So, some may consider dotman to be totally superfluous (and I might agree), but maybe others will get some use out if it.
Frankly, I wanted better diffing capabilities. I really wanted something like Gentoo’s powerful etc-update, but for now, vimdiff will have to do.
Examples:
comp1 $ dotman commit bashrc
-> ~/.bashrc gets uploaded to the remote repo
comp2 $ dotman grab bashrc
-> the remote bashrc gets pulled and vimdiff opens up, comparing your old config with the new one from the server (a copy of the old version gets stored to a backup directory)
Honestly, it’s that simple.