diff options
-rw-r--r-- | prompt_adam3_setup | 15 |
1 files changed, 10 insertions, 5 deletions
diff --git a/prompt_adam3_setup b/prompt_adam3_setup index 94e430f..10fd35e 100644 --- a/prompt_adam3_setup +++ b/prompt_adam3_setup @@ -17,21 +17,26 @@ prompt_adam3_setup () { prompt_adam3_color4=${4:-'green'} if [[ $prompt_adam3_color1 == 'multi' ]]; then - prompt_adam3_hostnamecolor=$(hostname | od | tr ' ' '\n' | awk '{total = total + $1}END{print 1 + (total % 24)}') - prompt_adam3_hostnamebold=$(hostname | od | tr ' ' '\n' | awk '{total = total + $1}END{print 1 + (total % 2)}') + #prompt_adam3_hostnamecolor=$(hostname | od | tr ' ' '\n' | awk '{total = total + $1}END{print 1 + (total % 24)}') + #prompt_adam3_hostnamebold=$(hostname | od | tr ' ' '\n' | awk '{total = total + $1}END{print 1 + (total % 2)}') - # hor testing purposes - #prompt_adam3_hostnamecolor=$(( ( $RANDOM % 24 ) + 1 )) - #prompt_adam3_hostnamebold=$(( $RANDOM % 2 )) + # for testing purposes + prompt_adam3_hostnamecolor=$(( ( $RANDOM % 24 ) + 1 )) + prompt_adam3_hostnamebold=$(( $RANDOM % 2 )) + # Possible prompt colors prompt_adam3_hostnamecolors=(black,red black,green black,yellow black,blue black,magenta black,cyan red,white red,yellow red,cyan green,black green,blue yellow,black yellow,blue blue,white blue,red blue,yellow magenta,white magenta,yellow cyan,white cyan,blue white,black white,red white,blue white,magenta) + # This is where we set up the actual prompt. base_hostname_prompt="%K{${${prompt_adam3_hostnamecolors[$prompt_adam3_hostnamecolor]}%,*}}%F{${${prompt_adam3_hostnamecolors[$prompt_adam3_hostnamecolor]}##*,}}%m%f%k" + + # this will set the hostname in bold in 50% of the time if [[ $prompt_adam3_hostnamebold -eq 1 ]]; then base_hostname_prompt="%B$base_hostname_prompt%b"; fi else + # If one wants a specific color, just set ut, plain and simple base_hostname_prompt="%K{$prompt_adam3_color1}%m%k" fi |