Lokaltog/powerline — pull request #880 by ZyX-I (2014-05-24 10:19:39+00:00)
Title: [RFC] Powerline config script

Adds powerline config script. Currently used only for version-specific tmux configuration sources, but there may be other applications:

- Shell configuration:

- Use `eval $(powerline-config shell zsh)` for configuring shells.
- Use `powerline-config shell zsh >> .zshrc` to make configuring shells easier and not suffer from delays due to python init/shutdown sequence (it is very fast on my system though). Not sure what is better to suggest in documentation.

- POWERLINE_COMMAND variable: there is lots of duplicate code, `powerline-config` may get rid of this via

- `powerline-config tmux configure_command [arguments]` (will run `tmux set-environment -g POWERLINE_COMMAND …`),
- `powerline-config print command` (will print executable name) and
- `powerline-config shell zsh command [arguments]` (will echo `export POWERLINE_COMMAND="{executable} arguments"` or `typeset -ga POWERLINE_COMMAND;POWERLINE_COMMAND=({executable} arguments)` depending on shell for use in `eval`).

This is very subjectable: will really not get rid of this completely, but at least narrow down number of lines used due to absence of code used to choose powerline version (here it chooses `powerline-client` if available, in daemon branch AFAIR it should choose client implementation (there are fastest C variant, less fast socat-based shell variant and slowest python variant)).

Maybe it make sense to use `powerline-config` to replace some POWERLINE_… configuration variables with `powerline-config show config.ext.ipython.tmux.colorscheme`-style calls. These calls also may be useful for debugging.

After #784 (specifically #418) it may make sense to use `powerline-config` to alter configuration.