From ab612bfeb17debe4c8c00a012b71e09e1c51bee3 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 19 Jan 2012 14:11:04 +0100 Subject: [Funcs] Better d1RtY zsh managment --- 12_Prompts.zsh | 38 +++++++++++++++++++++++++------------- 1 file changed, 25 insertions(+), 13 deletions(-) (limited to '12_Prompts.zsh') diff --git a/12_Prompts.zsh b/12_Prompts.zsh index fd0f61f..418e316 100644 --- a/12_Prompts.zsh +++ b/12_Prompts.zsh @@ -339,11 +339,27 @@ two_lines_prompt () ZSH_STATUS=$(zsh_status) if ( echo $ZSH_STATUS | grep -q -- "-D1rTY-" ) then - set_prompt_colors "$color[black]" - #echo -n $c_$prompt_colors[warning]$_c + echo + echo -n $c_$prompt_colors[warning]$_c #toilet -f bigmono9 "D1rTY Zsh.." - #echo $c_$prompt_colors[none]$_c - #echo + + HBAR=$(for i in {1..13} ; echo -n $_t_q) + VBAR=$T_$_t_x$_T + + echo -n " " + echo -n $T_$_t_l + echo -n $HBAR + echo -n $_t_k$_T + echo + echo " $VBAR WARNING !! $VBAR" + echo " $VBAR D1rTY Zsh.. $VBAR" + + echo -n " " + echo -n $T_$_t_m + echo -n $HBAR + echo -n $_t_j$_T + echo + echo $c_$prompt_colors[none]$_c fi precmd() @@ -351,21 +367,17 @@ precmd() # this MUST BE the real first operation else we lose the error code... error=$(print -Pn "%(?;;-%?)") + # d1RtY Zsh ... + ( echo $NEW_STATUS | grep -q -- "-D1rTY-" ) && set_prompt_colors "38;5;$(( $RANDOM % ( 88 - 16 ) + 16))" + NEW_STATUS=$(zsh_status) - if [ $NEW_STATUS != $ZSH_STATUS ] + if ! ( echo $NEW_STATUS | grep -q -- "-D1rTY-" ) then - if ! ( echo $NEW_STATUS | grep -q -- "-D1rTY-" ) + if [ $NEW_STATUS != $ZSH_STATUS ] then # You should restart Zsh set_prompt_colors "38;5;54" fi - - else - if ( echo $ZSH_STATUS | grep -q -- "-D1rTY-" ) - then - # Your Zsh working copy is not clean - set_prompt_colors "38;5;81" - fi fi update_prompt_elements -- cgit v1.2.3