aboutsummaryrefslogtreecommitdiff
path: root/bash/bashrc.d
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2016-04-23 02:37:50 +1200
committerTom Ryder <tom@sanctum.geek.nz>2016-04-23 02:37:50 +1200
commit535660daa076ad6b4c5143719b5860f95314b0d1 (patch)
treea6daa388c27ec45ad7024882dae1fd1277a5a8b7 /bash/bashrc.d
parentUpdate public key (diff)
downloaddotfiles-535660daa076ad6b4c5143719b5860f95314b0d1.tar.gz
dotfiles-535660daa076ad6b4c5143719b5860f95314b0d1.zip
Add means to change prompt color
Diffstat (limited to 'bash/bashrc.d')
-rw-r--r--bash/bashrc.d/prompt.bash11
1 files changed, 8 insertions, 3 deletions
diff --git a/bash/bashrc.d/prompt.bash b/bash/bashrc.d/prompt.bash
index d4ec0645..4c82cec0 100644
--- a/bash/bashrc.d/prompt.bash
+++ b/bash/bashrc.d/prompt.bash
@@ -49,15 +49,20 @@ prompt() {
# Check if we have non-bold bright green available
256)
format=$( {
- tput AF 10 || tput setaf 10 \
- || tput AF 10 0 0 || tput setaf 10 0 0
+ : "${PROMPT_COLOR:=10}"
+ tput AF "$PROMPT_COLOR" \
+ || tput setaf "$PROMPT_COLOR" \
+ || tput AF "$PROMPT_COLOR" 0 0 \
+ || tput setaf "$PROMPT_COLOR" 0 0
} 2>/dev/null )
;;
# If we have only eight colors, use bold green
8)
format=$( {
- tput AF 2 || tput setaf 2
+ : "${PROMPT_COLOR:=2}"
+ tput AF "$PROMPT_COLOR" \
+ || tput setaf "$PROMPT_COLOR"
tput md || tput bold
} 2>/dev/null )
;;