jimeh/tmuxifier — pull request #15 by jimeh (2013-06-14 10:49:56+00:00)
Title: New init system

This introduces a new way of initializing/loading Tmuxifier into your shell environment, while still being backwards compatible with the old way.

The main goal was to make it easy to package tmuxifier in package managers. As most package managers automatically make binaries available, the main tmuxifier executable had to be able to locate itself and set the `TMUXIFIER` variable on it's own, rather than the user specifically setting it to where he/she has installed tmuxifier.

The effective change to users is that instead of adding this to their shell setup:

```bash
export TMUXIFIER="$HOME/.dotfiles/tmuxifier"
[[ -s "$TMUXIFIER/init.sh" ]] && source "$TMUXIFIER/init.sh"
```

They instead add this:

```bash
eval "$(tmuxifier init -)"
```

Which effectively executes the same code that users manually added before, but the value of `TMUXIFIER` is specifically set to the relative path of where the `tmuxifier` binary resides.

The only down side is that users will have to add Tmuxifier's bin directory to their PATH themselves, or specify the full path to the `tmuxifier` binary.

The init scripts for bash/zsh and tcsh have also been modified to only set `TMUXIFIER` if needed, and only add Tmuxifier's bin directory to `PATH` if needed. This ensures backwards compatibility with the old installation/setup instructions.

/cc @peter-d