2a8d17a281a23b162a118819d694d7429c950cab
[config/bash_prompt.git] / styles / iceg
1 #!/bin/bash
2
3 # 'ice graphic' prompt
4
5 PS1="${RESET_CHARSET}"
6 PS1+="${BOLD_CYAN}${MODE_GRAPHIC}"
7 PS1+="${UPPER_LEFT_CORNER}${HORIZ_LINE}${HORIZ_LINE}${MODE_DEFAULT}"
8 PS1+="[ ${BOLD_WHITE}\\t${BOLD_CYAN} ]"
9 PS1+="${MODE_GRAPHIC}${HORIZ_LINE}${MODE_DEFAULT}"
10 PS1+="[ ${BOLD_WHITE}\\d${BOLD_CYAN} ]"
11 PS1+="${MODE_GRAPHIC}${HORIZ_LINE}${MODE_DEFAULT}"
12 PS1+="[${BOLD_WHITE}\\j${BOLD_CYAN}]"
13 PS1+="${MODE_GRAPHIC}${HORIZ_LINE}${MODE_DEFAULT}"
14 PS1+="[${BOLD_WHITE}\#${BOLD_CYAN}]"
15 PS1+="${MODE_GRAPHIC}${HORIZ_LINE}${MODE_DEFAULT}"
16 PS1+="[${BOLD_RED}\${ERR}${BOLD_CYAN}]"
17
18 # GST_ENV is set before the gst-build subshell starts and is valid until the
19 # subshell exits, so it's OK to only check it once and for all when the prompt
20 # is defined.
21 if [[ -n "${GST_ENV}" ]];
22 then
23   PS1+="${MODE_GRAPHIC}${HORIZ_LINE}${MODE_DEFAULT}[ ${BOLD_MAGENTA}${GST_ENV}${BOLD_CYAN} ]"
24 fi
25
26 # VCSH_DIRECTORY is set before a vcsh subshell starts and is valid until the
27 # subshell exits, so it's OK to only check it once and for all when the prompt
28 # is defined.
29 if [[ -n "${VCSH_DIRECTORY-}" ]];
30 then
31   PS1+="${MODE_GRAPHIC}${HORIZ_LINE}${MODE_DEFAULT}[ ${BOLD_YELLOW}VCSH repo: ${BOLD_WHITE}${VCSH_DIRECTORY}${BOLD_CYAN} ]"
32 fi
33
34 if declare -F __git_ps1 >/dev/null;
35 then
36   # Tell which git branch is currently active.
37   PS1+='$(__git_ps1 '
38   PS1+="'"
39   PS1+="${MODE_GRAPHIC_QUOTED}${HORIZ_LINE}${MODE_DEFAULT_QUOTED}[ ${BOLD_YELLOW}"
40   PS1+="Git branch: ${BOLD_WHITE}%s"
41   PS1+="${BOLD_CYAN} ]"
42   PS1+="'"
43   PS1+=')'
44 fi
45
46 PS1+="${MODE_GRAPHIC}${HORIZ_LINE}${HORIZ_LINE}${MODE_DEFAULT}\\n"
47
48 # XXX specifying the color again should not be necessary but bash seems to
49 # forget about the color of the previous prompt line when resizing a terminal
50 # window.
51 PS1+="${BOLD_CYAN}${MODE_GRAPHIC}${LOWER_LEFT_CORNER}${HORIZ_LINE}${HORIZ_LINE}${MODE_DEFAULT}"
52 PS1+="[ ${BOLD_WHITE}\\u${BOLD_CYAN}${WHITE}@${BOLD_WHITE}\\h${BOLD_CYAN}"
53 PS1+=":${BOLD_WHITE}\\w${BOLD_CYAN} ]${RESET}\\$ "