From 273644abe162d1a7a3e98c392403162a00224628 Mon Sep 17 00:00:00 2001 From: Tanaka Akira Date: Thu, 18 Nov 1999 15:15:27 +0000 Subject: Initial revision --- Functions/Prompts/prompt_bigfade_setup | 50 ++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 Functions/Prompts/prompt_bigfade_setup (limited to 'Functions/Prompts/prompt_bigfade_setup') diff --git a/Functions/Prompts/prompt_bigfade_setup b/Functions/Prompts/prompt_bigfade_setup new file mode 100644 index 000000000..260c0ddf0 --- /dev/null +++ b/Functions/Prompts/prompt_bigfade_setup @@ -0,0 +1,50 @@ +# Generic large colour fade-bar prompt theme from bashprompt +# Created by James Manning +# Changed by Spidey 08/06 +# Converted to zsh prompt theme by + +prompt_bigfade_help () { + cat < [ [ []]]] + +where the parameters are the colors for the fade-bar, user@host text, +date text, and current working directory respectively. The default +colors are blue, white, white, and yellow. 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, the 8-bit characters will probably look stupid. +EOH +} + +prompt_bigfade_setup () { + local fadebar=${1:-'blue'} + local userhost=${2:-'white'} + local date=${3:-'white'} + local cwd=${4:-'yellow'} + + for code in 333 262 261 260 260 261 262 333 333 262 261 260 333 262 261 260 260 261 262 333 333 262 261 260; do + local varname=char_$code + : ${(P)varname=$(echo -n "\\0$code")} + done + + PS1="%{$bold_color$fg[$fadebar]$bold_color%}$char_333$char_262$char_261$char_260%{$bold_color$fg[$userhost]$bg[$fadebar]%}%n@%m%{$reset_color$fg[$fadebar]$bg[grey]%}$char_260$char_261$char_262$char_333%{$reset_color$fg[$fadebar]$bg[grey]%}$char_333$char_262$char_261$char_260%{$bold_color$fg[$date]$bg[grey]%} %D{%a %b %d} %D{%I:%M:%S%P}$prompt_newline%{$bold_color$fg[$cwd]$bg[grey]%}$PWD>%{$reset_color%} " + PS2="%{$bold_color$fg[$fadebar]$bold_color%}$char_333$char_262$char_261$char_260%{$reset_color$fg[$fadebar]$bg[grey]%}$char_260$char_261$char_262$char_333%{$reset_color$fg[$fadebar]$bg[grey]%}$char_333$char_262$char_261$char_260%{$bold_color$bold_color$fg[$fadebar]%}>%{$reset_color%} " + + precmd () { setopt promptsubst } + preexec () { } +} + +prompt_bigfade_preview () { + if (( ! $#* )); then + prompt_preview_theme bigfade + print + prompt_preview_theme bigfade red white grey white + else + prompt_preview_theme bigfade "$@" + fi +} + +prompt_bigfade_setup "$@" -- cgit 1.4.1