From: Mark Szymanski Date: Tue, 15 Feb 2011 03:12:25 +0000 (-0600) Subject: Added modern-t theme, theme to be used with the t (http://stevelosh.com/projects... X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=2228826861098b1270d2689ccb7ffd894202e049;p=common%2Fbash_it.git Added modern-t theme, theme to be used with the t (stevelosh.com/projects/t/) utility --- diff --git a/themes/modern-t/modern-t.theme.bash b/themes/modern-t/modern-t.theme.bash new file mode 100644 index 0000000..55da6e1 --- /dev/null +++ b/themes/modern-t/modern-t.theme.bash @@ -0,0 +1,56 @@ +SCM_THEME_PROMPT_PREFIX="" +SCM_THEME_PROMPT_SUFFIX="" + +SCM_THEME_PROMPT_DIRTY=' ${bold_red}✗${normal}' +SCM_THEME_PROMPT_CLEAN=' ${bold_green}✓${normal}' +SCM_GIT_CHAR='${bold_green}±${normal}' +SCM_SVN_CHAR='${bold_cyan}⑆${normal}' +SCM_HG_CHAR='${bold_red}☿${normal}' + +case $TERM in + xterm*) + TITLEBAR="\[\033]0;\w\007\]" + ;; + *) + TITLEBAR="" + ;; +esac + +PS3=">> " + +is_vim_shell() { + if [ ! -z "$VIMRUNTIME" ] + then + echo "[${cyan}vim shell${normal}]" + fi +} + +modern_scm_prompt() { + CHAR=$(scm_char) + if [ $CHAR = $SCM_NONE_CHAR ] + then + return + else + echo "[$(scm_char)][$(scm_prompt_info)]" + fi +} + +prompt() { + if [ $? -ne 0 ] + then + # Yes, the indenting on these is weird, but it has to be like + # this otherwise it won't display properly. + + PS1="${TITLEBAR}${bold_red}┌─[${cyan}$(t | wc -l | sed -e's/ *//')${reset_color}]${reset_color}$(modern_scm_prompt)[${cyan}\W${normal}]$(is_vim_shell) +${bold_red}└─▪${normal} " + else + PS1="${TITLEBAR}┌─[${cyan}$(t | wc -l | sed -e's/ *//')${reset_color}]$(modern_scm_prompt)[${cyan}\W${normal}]$(is_vim_shell) +└─▪ " + fi +} + +PS2="└─▪ " + + + +PROMPT_COMMAND=prompt