dotman - A Dotfile Manager
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:
- Upload a set of master configs to a remote repository.
- Grab that config on each of your environments.
- ... 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
- :pass is optional
- user:pass@ is optional
- :port is optional
- ... and the second : is optional, too.
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:
- %local% - the local copy of the config (stored in bak/)
- %remote% - the remote copy of the config (stored in tmp/)
- %outfile% - the original location of the local config
If you don't want to do any merging, just set:
- merge=cp %remote% %outfile%
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
- 0.12 - regex for protocol string is much more powerful; see installation section for details
- 0.11 - fixed bug when trying to download config that doesn't already exist in local system, changed default .dotman.conf
- 0.1 - initial release
