aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/prompt_adam3_setup
diff options
context:
space:
mode:
authorDennis Eriksen <dennis@eriksen.im>2015-06-29 22:00:40 +0200
committerDennis Eriksen <dennis@eriksen.im>2015-06-29 22:00:40 +0200
commit8b6f0c91ff838bdde8d4acb26073ec28eca389e5 (patch)
tree9a5f57083a76bb79952f7b730b1b078a040652bf /prompt_adam3_setup
parentadding multicolouring based on hostname (diff)
downloadadam3-8b6f0c91ff838bdde8d4acb26073ec28eca389e5.tar.gz
adding some comments
Diffstat (limited to 'prompt_adam3_setup')
-rw-r--r--prompt_adam3_setup15
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