From: Jesus de Mula Cano Date: Fri, 4 Mar 2011 10:44:56 +0000 (+0100) Subject: Added demula theme X-Git-Url: https://source.supwisdom.com/gerrit/gitweb?a=commitdiff_plain;h=a38012fb1822502bed12523c68faa2e6dd3dc3bd;p=common%2Fbash_it.git Added demula theme --- diff --git a/themes/demula/demula.theme.bash b/themes/demula/demula.theme.bash new file mode 100644 index 0000000..33396d9 --- /dev/null +++ b/themes/demula/demula.theme.bash @@ -0,0 +1,60 @@ +# ------------------------------------------------------------------ COLOR CONF +D_DEFAULT_COLOR='${gray}' +D_USER_COLOR='${purple}' +D_SUPERUSER_COLOR='${red}' +D_MACHINE_COLOR='${cyan}' +D_DIR_COLOR='${green}' +D_SCM_COLOR='${yellow}' +D_BRANCH_COLOR='${yellow}' +D_CHANGES_COLOR='${white}' +D_CMDFAIL_COLOR='${red}' + +case $TERM in + xterm*) + TITLEBAR="\[\033]0;\w\007\]" + ;; + *) + TITLEBAR="" + ;; +esac + +PS3=">> " + +is_vim_shell() { + if [ ! -z "$VIMRUNTIME" ] + then + echo "on ${cyan}vim shell${white} " + fi +} + +mitsuhikos_lastcommandfailed() { + code=$? + if [ $code != 0 ]; then + echo -n '\[${white}\]exited \[${red}\]' + echo -n $code + echo -n '\[${white}\] ' + fi +} + +D_VCPROMPT_EXECUTABLE=~/.vcprompt/bin/vcprompt +D_VCPROMPT_FORMAT="on ${D_SCM_COLOR}%s${white}:${D_BRANCH_COLOR}%b %r ${D_CHANGES_COLOR}%m%u ${white}" +demula_vcprompt() { + $D_VCPROMPT_EXECUTABLE -f "$D_VCPROMPT_FORMAT" +} + +prompt() { + # Yes, the indenting on these is weird, but it has to be like + # this otherwise it won't display properly. + + PS1="\n${TITLEBAR}\[${D_USER_COLOR}\]\u ${white}\ +at \[${D_MACHINE_COLOR}\]\h ${white}\ +in \[${D_DIR_COLOR}\]\w ${white}\ +$(mitsuhikos_lastcommandfailed)\ +$(demula_vcprompt)\ +$(is_vim_shell) +$ ${normal}" +} + +PS2="$ " + +PROMPT_COMMAND=prompt