From 1638a1a4351aa987284e7a7a42fd2e6ff1119b01 Mon Sep 17 00:00:00 2001 From: Travis Swicegood Date: Mon, 28 Feb 2011 14:18:46 -0600 Subject: [PATCH] Allow setting a custom host color This change allows someone to change their host color by adding the following to their `.bash_profile`: # change to red THEME_PROMPT_HOST_COLOR="red" # change to green THEME_PROMPT_HOST_COLOR="green" Any variable inside the `colors.theme.bash` can be used and it will be evaluated at the last minute. --- themes/doubletime/doubletime.theme.bash | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/themes/doubletime/doubletime.theme.bash b/themes/doubletime/doubletime.theme.bash index 55df693..29dfa00 100644 --- a/themes/doubletime/doubletime.theme.bash +++ b/themes/doubletime/doubletime.theme.bash @@ -9,6 +9,12 @@ SCM_THEME_PROMPT_SUFFIX="" RVM_THEME_PROMPT_PREFIX=" (" RVM_THEME_PROMPT_SUFFIX=")" +if [ ! -z $THEME_PROMPT_HOST_COLOR ]; then + THEME_PROMPT_HOST_COLOR=$(eval echo $`echo ${THEME_PROMPT_HOST_COLOR}`); +else + THEME_PROMPT_HOST_COLOR="$blue" +fi + doubletime_scm_prompt() { CHAR=$(scm_char) if [ $CHAR = $SCM_NONE_CHAR ] @@ -25,7 +31,7 @@ prompt_setter() { history -c history -r PS1=" -\t $(scm_char) [\[$blue\]\u@${THEME_PROMPT_HOST}\[$reset_color\]] \w +\t $(scm_char) [\[$THEME_PROMPT_HOST_COLOR\]\u@${THEME_PROMPT_HOST}\[$reset_color\]] \w $(doubletime_scm_prompt)\[$reset_color\] $ " PS2='> ' PS4='+ ' -- 2.17.1