From 1020467e614c197a3ce813659cd4150dd5b97bba Mon Sep 17 00:00:00 2001 From: Michael Komitee Date: Sun, 26 Dec 2010 17:38:30 -0500 Subject: [PATCH] updating prompt --- themes/komitee.zsh-theme | 26 +++++++++++++++++++++++++- 1 file changed, 25 insertions(+), 1 deletion(-) diff --git a/themes/komitee.zsh-theme b/themes/komitee.zsh-theme index 0494a00c6..e57c2af02 100644 --- a/themes/komitee.zsh-theme +++ b/themes/komitee.zsh-theme @@ -15,7 +15,31 @@ fi local prompt_char="%{$fg[$prompt_color]%}%#%{$reset_color%}" -PROMPT="%{$fg[cyan]%}[${user_host} %{$fg[yellow]%}%~%{$fg[cyan]%}]${prompt_char} " +jobs_prompt_info() { + local JOBS_S_C=$(jobs -s | wc -l | sed -e 's/ //g') + local JOBS_R_C=$(jobs -r | wc -l | sed -e 's/ //g') + if [ "$JOBS_S_C" = "0" ] || [ "$JOBS_S_C" = "" ]; then + local JOBS_S="" + else + local JOBS_S="%{$fg[red]%}[%{$fg[yellow]%}${JOBS_S_C}%{$fg[red]%}]%{$reset_color%}" + fi + + if [ "$JOBS_R_C" = "0" ] || [ "$JOBS_R_C" = "" ]; then + local JOBS_R="" + else + local JOBS_R="%{$fg[green]%}[%{$fg[yellow]%}${JOBS_R_C}%{$fg[green]%}]%{$reset_color%}" + fi + + echo "${JOBS_S}${JOBS_R}" +} + +if [ "$SHLVL" = "0" ] || [ "$SHLVL" = "1" ] || [ "$SHLVL" = "" ]; then + shell_level="" +else + shell_level="%{$fg[cyan]%}(%{$fg[red]%}$[${SHLVL} - 1]%{$fg[cyan]%})%{$reset_color%}" +fi + +PROMPT='%{$fg[cyan]%}[${user_host} %{$fg[yellow]%}%~%{$fg[cyan]%}]$(jobs_prompt_info)${shell_level} ${prompt_char} ' # Setup vi mode indicator MODE_INDICATOR="%{$fg_bold[yellow]%}%{$reset_color%}"