From 535660daa076ad6b4c5143719b5860f95314b0d1 Mon Sep 17 00:00:00 2001 From: Tom Ryder Date: Sat, 23 Apr 2016 02:37:50 +1200 Subject: Add means to change prompt color --- bash/bashrc.d/prompt.bash | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'bash/bashrc.d/prompt.bash') 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 ) ;; -- cgit v1.2.3