dotman - A Dotfile Manager

Links

 

Intro

Configuration files can be somewhat difficult to manage across multiple environments. For example, say you have a desktop, a laptop, and a server and want to use a program on all three; the configuration for the program will be mostly the same, but there are a few slight differences specific to each platform. Unfortunately, the configuration scheme for this program does not allow you to source a second config (which would allow you to have a master config and then three "local" configs for each platform).

dotman saves the day by allowing you to:

  1. Upload a set of master configs to a remote repository.
  2. Grab that config on each of your environments.
  3. ... and diff it against the previous config so you can make localized changes.

 

Installation

If you use Arch Linux, there's a package in the AUR for dotman.

Otherwise, just extract the archive and stick dotman.py wherever you want.

Run it once with no arguments; it will create a default configuration file for you. Edit that configuration according to the provided instructions.

Note that the repo variable currently only supports transfer via SSH/SFTP. The syntax is:

sftp://user:pass@host.tld:port:/dir1/dir2/dir3

 

How it Works

The configs that dotman manages are stored in the [aliases] section. Each unique alias must point to a file and the same alias name must be used across environments (e.g. if you label ~/.bashrc as bashrc, it must be labeled the same for every computer). _commit_ your configs to the remote repository and start _grab_bing them from each local computer to sync everything. If you grab a file, dotman will store the old one to the bak/ directory. Note that only *one* revision will be stored. The default merge utility uses vimdiff. Edit the file on the right (the copy pulled from the remote server) and save it. Then, it will get copied over to the config's proper location. You can edit the merge utility. Just use the following keywords:

If you don't want to do any merging, just set:

 

Other Notes

If you have any comments, feel free to contact me. This is a very early release; I have more stuff planned to be done eventually. This software is licensed under the MIT License. See the LICENSE file for more details.

 

Changelog