styles/iceg: handle the case of an unset GST_ENV when testing for it
[config/bash_prompt.git] / styles / ice
1 #!/bin/bash
2
3 # 'ice' prompt
4
5 PS1="${RESET_CHARSET}"
6 PS1+="${BOLD_CYAN}/-=[ ${BOLD_WHITE}\\t${BOLD_CYAN} ]-"
7 PS1+="[ ${BOLD_WHITE}\\d${BOLD_CYAN} ]-"
8 PS1+="[${BOLD_WHITE}\\j${BOLD_CYAN}]-"
9 PS1+="[${BOLD_WHITE}\#${BOLD_CYAN}]-"
10 PS1+="[${BOLD_RED}\${ERR}${BOLD_CYAN}]"
11
12 # VCSH_DIRECTORY is set before a vcsh subshell starts and is valid until the
13 # subshell exits, so it's OK to only check it once and for all when the prompt
14 # is defined.
15 if [[ -n "${VCSH_DIRECTORY-}" ]];
16 then
17   PS1+="-[ ${BOLD_YELLOW}VCSH repo: ${BOLD_WHITE}${VCSH_DIRECTORY}${BOLD_CYAN} ]"
18 fi
19
20 if declare -F __git_ps1 >/dev/null;
21 then
22   # Tell which git branch is currently active.
23   PS1+='$(__git_ps1 '
24   PS1+="'"
25   PS1+="-[ ${BOLD_YELLOW}"
26   PS1+="Git branch: ${BOLD_WHITE}%s"
27   PS1+="${BOLD_CYAN} ]"
28   PS1+="'"
29   PS1+=')'
30 fi
31
32 PS1+="=-\\n"
33 PS1+="${BOLD_CYAN}\\-=["
34 PS1+=" ${BOLD_WHITE}\\u${BOLD_CYAN}${WHITE}@${BOLD_WHITE}\\h${BOLD_CYAN}"
35 PS1+=":${BOLD_WHITE}\\w${BOLD_CYAN} ]${RESET}\\$ "