@c -*- texinfo -*-

@chapter Prompt Hooks

Some of the supplied prompt styles of @b{BashStyle-NG} allow hooking into them,
meaning you can define a function that will be automatically called from the prompt.

This allows you to add  custom content to existing styles, without having to use
the custom prompt builder or start from scratch. You need to place the desired
hook in the file:

    @file{$HOME/.bashstyle.custom}

The following lists the prompt style, name of the hook and where it takes effect:

separator style
@itemize @bullet
@item SEPA_1() | at the start of the prompt
@item SEPA_2() | at the end of the prompt
@end itemize

vector style
@itemize @bullet
@item VECTOR_1() | after time/date entry
@item VECTOR_2() | at the end of the prompt
@end itemize

clock style
@itemize @bullet
@item CLOCK() | at the end of the prompt
@end itemize

equinox style
@itemize @bullet
@item EQUINOX_1() | before the user symbol
@end itemize

elite style
@itemize @bullet
@item ELITE_1() | at the end of the prompt
@end itemize

poweruser style
@itemize @bullet
@item POWER_1() | before the user symbol
@end itemize

dirks style
@itemize @bullet
@item DIRKS_1() | at the end of the first line
@item DIRKS_2() | at the end of the prompt
@end itemize

sepa-ng style
@itemize @bullet
@item SEPA_NG_1() | at the end of the prompt
@end itemize

quirk style
@itemize @bullet
@item QUIRK_1() | at the end of the prompt
@end itemize

Additonally each hook-part features a color variable with the same naming scheme, eg.:
@itemize @bullet
@item SEPA_1() is colored by $SEPA_1_COLOR
@item VECTOR_2() is colored by $VECTOR_2_COLOR
@end itemize

You can use one of the following predefined color names:
@itemize @bullet
@item black
@item red
@item green
@item yellow
@item blue
@item magenta
@item cyan
@item grey
@item white
@item coldblue
@item smoothblue
@item iceblue
@item turqoise
@item smoothgreen
@item winered
@item brown
@item silver
@item ocher
@item orange
@item purple
@item pink
@item cream
@end itemize

If you want to use theese predefinied colors not in the variable, but in the
function, you can access printable versions by prepending @code{e} to the color
name, eg.:
@itemize @bullet
@item black -> eblack
@item white -> ewhite
@end itemize

@b{Note:} if the terminal is set to dark (in the Style settings), then black
becomes white, else white becomes black, that's not a bug, but a feature.

Here's an example that hooks into the @b{sepa-ng} prompt, we use @code{gitkit}
o show branch, revision (like svn revision) and current action in repository in
yellow:

@example
SEPA_NG_1_COLOR=$yellow
SEPA_NG_1 () @{
    echo -e " $(gitkit branch):$(gitkit revno):$(gitkit action) "
@}
@end example