README: improve wording an provide a more robust example of use
[config/bash_prompt.git] / styles / matrix
1 #!/bin/bash
2
3 # 'matrix' prompt
4
5 PS1="${RESET_CHARSET}"
6 PS1+="${BOLD_GREEN}..::["
7 PS1+=" ${GREEN}b${BOLD_GREEN}A${BOLD_WHITE}S${GREEN}h"
8 PS1+=" ${BOLD_GREEN}i${BOLD_WHITE}n"
9 PS1+=" ${BOLD_GREEN}T${GREEN}h${BOLD_GREEN}E"
10 PS1+=" ${BOLD_GREEN}M${BOLD_WHITE}a${BOLD_GREEN}T${GREEN}R${BOLD_WHITE}i${GREEN}X"
11 PS1+="${BOLD_GREEN}]-"
12 PS1+="[ ${GREEN}\\d ${BOLD_GREEN}]-"
13 PS1+="[${BOLD_WHITE}\${ERR}${BOLD_GREEN}]"
14
15 # VCSH_DIRECTORY is set before a vcsh subshell starts and is valid until the
16 # subshell exits, so it's OK to only check it once and for all when the prompt
17 # is defined.
18 if [[ -n "${VCSH_DIRECTORY-}" ]];
19 then
20   PS1+="-[ ${BOLD_YELLOW}VCSH repo: ${BOLD_WHITE}${VCSH_DIRECTORY}${BOLD_GREEN} ]"
21 fi
22
23 if declare -F __git_ps1 >/dev/null;
24 then
25   # Tell which git branch is currently active.
26   PS1+='$(__git_ps1 '
27   PS1+="'"
28   PS1+="-[ ${BOLD_YELLOW}"
29   PS1+="Git branch: ${BOLD_WHITE}%s"
30   PS1+="${BOLD_GREEN} ]"
31   PS1+="'"
32   PS1+=')'
33 fi
34
35
36 PS1+="::..\\n"
37 PS1+="${BOLD_GREEN}..::["
38 PS1+=" ${BOLD_WHITE}\\u${GREEN}@${BOLD_WHITE}\\h${BOLD_GREEN}"
39 PS1+=":${BOLD_WHITE}\\w${BOLD_GREEN} ]${BOLD_WHITE}>${RESET} "