zshrc: New prompt: Add promptsys help (-h) text

And also, a few required stubs.

Signed-off-by: Frank Terbeck <ft@grml.org>
zshrc: New prompt: Register prompt theme with promptsys

This requires a little more care, since promptinit only picks up
themes from $fpath; which we don't do. We define the prompt directly
in the zshrc file.

Signed-off-by: Frank Terbeck <ft@grml.org>
zshrc: New prompt: Implement the basic grml prompt framework

This actually already implements most of the stuff, that is in
our usual prompt.

Signed-off-by: Frank Terbeck <ft@grml.org>
zshrc: New prompt: Move more precmd() code to hook fncs

Signed-off-by: Frank Terbeck <ft@grml.org>
zshrc: New prompt: Allow `items' list for PS1 _and_ RPS1

We have this $PERCENT bit, that tracks battery status. And to integrate
that into the framework requires either a lot of code specialisation and
duplication, or we refactor the PS1 setting loop so it can set RSP1,
too.

This changes the configuration scheme a bit. Dokumentation updated
accordingly.

Signed-off-by: Frank Terbeck <ft@grml.org>
zshrc: New prompt: support [[ $BATTERY -gt 0 ]]

Signed-off-by: Frank Terbeck <ft@grml.org>
zshrc: New prompt: Support TERM == dumb

Signed-off-by: Frank Terbeck <ft@grml.org>
zshrc: New prompt: Username in red for root

Signed-off-by: Frank Terbeck <ft@grml.org>
zshrc: New prompt: Add new theme: grml-large

This is what should be enabled if GRMLPROMPT=1 was specified by the user.

Signed-off-by: Frank Terbeck <ft@grml.org>
zshrc: New prompt: Add new theme: grml-chroot

This should replace the GRML_CHROOT specific prompt.

Signed-off-by: Frank Terbeck <ft@grml.org>
zshrc: New prompt: Fix wrong logic for user name colouring

Signed-off-by: Frank Terbeck <ft@grml.org>
zshrc: Enable the grml prompt theme via promptsys

Signed-off-by: Frank Terbeck <ft@grml.org>
zshrc: New prompt: Fix quoting style in dumb-terminal config

Signed-off-by: Frank Terbeck <ft@grml.org>
zshrc: New prompt: Handle grml-chroot in dumb-terminal config

Signed-off-by: Frank Terbeck <ft@grml.org>
zshrc: New prompt: Enable one of the prompts

Mimic the old way of choosing the "right" prompt.

Signed-off-by: Frank Terbeck <ft@grml.org>
zshrc: New prompt: Provide fallback in case promptinit fails

This should not happen usually. But better be safe than sorry.

In case something goes wrong we only support _one_ prompt, with the original
root-is-red changeroo.  This is good enough as a fallback.

Signed-off-by: Frank Terbeck <ft@grml.org>
zshrc: New prompt: Remove old prompt setting scheme

Signed-off-by: Frank Terbeck <ft@grml.org>
zshrc: New prompt: Reorganise the prompt section

Signed-off-by: Frank Terbeck <ft@grml.org>
zshrc: New prompt: Only enable prompt themes with zsh >= 4.3.7

The themes do use modern features, that require this constraint.

The fallback prompt, that was being used when promptsys wasn't available
is _way_ more backwards compatible (and will remain like that). Use that
fallback in cases of $ZSH_VERSION < 4.3.7 as well.

This also means, that the GRMLPROMPT=1 and [[ -n $GRML_CHROOT ]] prompts
are not available with shells that old. Version 4.3.7 of zsh was
released on 2008-10-28. I think it's reasonable to require ~5 year old
software for the full-blown version of a setup. The last stable debian
release ships version 4.3.10 and the upcoming release will sport version
4.3.17. Grml ISOs come with version >= 5.0.0.

Signed-off-by: Frank Terbeck <ft@grml.org>
zshrc: Use a non-forking expression to read /etc/debian_chroot

Signed-off-by: Frank Terbeck <ft@grml.org>