summaryrefslogtreecommitdiff
path: root/12_Prompts.zsh
diff options
context:
space:
mode:
authorHugues Hiegel <hugues@hiegel.fr>2012-01-19 14:11:04 +0100
committerHugues Hiegel <hugues.hiegel@qosmos.com>2012-01-19 14:20:40 +0100
commitab612bfeb17debe4c8c00a012b71e09e1c51bee3 (patch)
tree5929aed7257ba152577ff0c1b5c932161a2304cc /12_Prompts.zsh
parent35c312987b80bfb17828561de4c9839a95f14357 (diff)
[Funcs] Better d1RtY zsh managment
Diffstat (limited to '12_Prompts.zsh')
-rw-r--r--12_Prompts.zsh38
1 files changed, 25 insertions, 13 deletions
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