about summary refs log tree commit diff
path: root/Functions/Prompts/prompt_adam1_setup
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-07-03 17:06:04 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-07-03 17:06:04 +0000
commit876fa2c44e0a17b2d10a2547ac1d13687cfed520 (patch)
treef92ce7475c97f82a05e20e9ba8be9b83436c9b6b /Functions/Prompts/prompt_adam1_setup
parent6fa964914d8be709b1145399108ef1535a0b3f39 (diff)
downloadzsh-876fa2c44e0a17b2d10a2547ac1d13687cfed520.tar.gz
zsh-876fa2c44e0a17b2d10a2547ac1d13687cfed520.tar.xz
zsh-876fa2c44e0a17b2d10a2547ac1d13687cfed520.zip
unposted: force latest version of files from vendor to main branch
Diffstat (limited to 'Functions/Prompts/prompt_adam1_setup')
-rw-r--r--Functions/Prompts/prompt_adam1_setup29
1 files changed, 26 insertions, 3 deletions
diff --git a/Functions/Prompts/prompt_adam1_setup b/Functions/Prompts/prompt_adam1_setup
index 65d1b68c0..19b7737eb 100644
--- a/Functions/Prompts/prompt_adam1_setup
+++ b/Functions/Prompts/prompt_adam1_setup
@@ -1,7 +1,30 @@
 # adam1 prompt theme
 
+prompt_adam1_help () {
+  cat <<'EOF'
+This prompt is color-scheme-able.  You can invoke it thus:
+
+  prompt adam1 [<color1> [<color2> [<color3>]]]
+
+where the colors are for the user@host background, current working
+directory, and current working directory if the prompt is split over
+two lines respectively.  The default colors are blue, cyan and green.
+This theme works best with a dark background.
+
+Recommended fonts for this theme: nexus or vga or similar.  If you
+don't have any of these, then specify the `plain' option to use 7-bit
+replacements for the 8-bit characters.
+
+And you probably thought adam1 was overkill.
+EOF
+}
+
 prompt_adam1_setup () {
-  base_prompt="%{$bg_no_bold_blue%}%n@%m%{$reset_color%} "
+  prompt_adam1_color1=${1:-'blue'}
+  prompt_adam1_color2=${2:-'cyan'}
+  prompt_adam1_color3=${3:-'green'}
+
+  base_prompt="%{$bg_no_bold[$prompt_adam1_color1]%}%n@%m%{$reset_color%} "
   post_prompt="%{$reset_color%}"
 
   base_prompt_no_color=$(echo "$base_prompt" | perl -pe "s/%{.*?%}//g")
@@ -20,10 +43,10 @@ prompt_adam1_precmd () {
   base_prompt_etc=$(print -P "$base_prompt%(4~|...|)%3~")
   prompt_length=${#base_prompt_etc}
   if [[ $prompt_length -lt 40 ]]; then
-    path_prompt="%{$fg_bold_cyan%}%(4~|...|)%3~%{$fg_bold_white%}"
+    path_prompt="%{$fg_bold[$prompt_adam1_color2]%}%(4~|...|)%3~%{$fg_bold[white]%}"
   else
     space_left=$(( $COLUMNS - $#base_prompt_expanded_no_color - 2 ))
-    path_prompt="%{$fg_bold_green%}%${space_left}<...<%~$prompt_newline%{$fg_bold_white%}"
+    path_prompt="%{$fg_bold[$prompt_adam1_color3]%}%${space_left}<...<%~$prompt_newline%{$fg_bold_white%}"
   fi
   PS1="$base_prompt$path_prompt %# $post_prompt"
   PS2="$base_prompt$path_prompt %_> $post_prompt"