ConMan: Configuration-file Manager

ConMan is tool for managing dotfiles and other config files on multiple Unix systems, each requiring largely the same set of files but with minor changes in each location. The system is built on the m4 macro processor which is widely installed and reasonably powerful.

As well as simplifying the keeping of dotfiles in a git repository (as the files are automatically copied from the repository to their appropriate locations), conman also provides many other features.

Tweak Configs on a Machine-by-Machine Basis

Use conditional statements to enable certain configuration lines only on some computers without creating multiple versions of the config file. For example, from my bash_profile:

ON_COMPUTER(THINKPAD)
# Auto-start the graphical session on login
[ -z "$DISPLAY" -a "$(tty)" = "/dev/tty1" ] && startx
END_COMPUTER()
M3-Powered Config Files

All your config files are now m4 macros allowing you to take the boring repetition out of repetitive configuration files. For example, here is an excerpt my i3 (window manager) config file:

# Resize to absolute percentages using the num keys
forloop(`i', 1, 9, `
    bindsym i exec --no-startup-id python ~/.i3/i3resize.py i`'0
')
Pull in Git-Repositories

Automatically pull certain Git repositories in your config files, for example to fetch Vim plugins:

define(VIM_MODULE, `GIT_REPO(~/.vim/bundle/$1, $2)')
define(PROTO, IF_COMPUTER(LAPTOP, https, git))

VIM_MODULE(pathogen      , PROTO://github.com/tpope/vim-pathogen.git)
VIM_MODULE(fugitive      , PROTO://github.com/tpope/vim-fugitive.git)
VIM_MODULE(ctrlp         , PROTO://github.com/kien/ctrlp.vim.git)
VIM_MODULE(jellybeans    , PROTO://github.com/nanotech/jellybeans.vim.git)
...

Download/Examples

The version of conman referred to here is my fork of Tom Nixon's original version. You can find my fork in the following places on GitHub:

Tutorial

A tutorial on how to use ConMan is available in the project README.