From a59d7858831b231660d2d24548abc19e53da30bb Mon Sep 17 00:00:00 2001 From: rjorgenson Date: Fri, 17 Jun 2011 23:28:57 -0700 Subject: [PATCH] added todo.txt-cli count to prompt and cleaned up some color code not sure if I like the placement of the todo count, but keeping it for now --- themes/rjorgenson/rjorgenson.theme.bash | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/themes/rjorgenson/rjorgenson.theme.bash b/themes/rjorgenson/rjorgenson.theme.bash index afd3ea4..42d58a3 100644 --- a/themes/rjorgenson/rjorgenson.theme.bash +++ b/themes/rjorgenson/rjorgenson.theme.bash @@ -38,6 +38,13 @@ is_vim_shell() { fi } +todo_txt_count() { + if `hash todo.sh 2>&-`; then + count=`todo.sh ls | egrep "TODO: [0-9]+ of ([0-9]+) tasks shown" | awk '{ print $4 }'` + echo "[T:$count]" + fi +} + modern_scm_prompt() { CHAR=$(scm_char) if [ $CHAR = $SCM_NONE_CHAR ] @@ -51,9 +58,9 @@ modern_scm_prompt() { prompt() { my_ps_host="${bold_green}\h${normal}"; - my_ps_user="\[\033[01;32m\]\u\[\033[00m\]"; - my_ps_root="\[\033[01;31m\]\u\[\033[00m\]"; - my_ps_path="\[\033[01;36m\]\w\[\033[00m\]"; + my_ps_user="${bold_green}\u${normal}"; + my_ps_root="${bold_red}\u${normal}"; + my_ps_path="${bold_cyan}\w${normal}"; # nice prompt case "`id -u`" in @@ -61,7 +68,7 @@ prompt() { └─▪ " ;; *) PS1="${TITLEBAR}┌─[$my_ps_user][$my_ps_host]$(modern_scm_prompt)$(__my_rvm_ruby_version)[${cyan}\w${normal}]$(is_vim_shell) -└─▪ " +└─▪$(todo_txt_count) " ;; esac } -- 2.17.1