simpler punctuation and colorscheme

* less punctuation: replace brackets with a single letter around battery, load, nothing around jobs and return value
* avoid extra spaces
* uncolored punctuation
* color the prompt mark in red if root, else in bold white
* user in light white and working dir in bold white
This commit is contained in:
nojhan 2012-07-17 10:18:03 +02:00
commit 03e500fea2

View file

@ -121,7 +121,7 @@ __host_color()
if [ "$conn" == "lcl" ] ; then
ret="${ret}" # no hostname if local
elif [ "$conn" == "ssh" ] ; then
ret="${ret}@${CYAN}\h"
ret="${ret}@${LIGHT_CYAN}\h "
elif [ "$conn" == "tel" ] ; then
ret="${ret}@${WARN_RED}\h "
else
@ -144,13 +144,13 @@ __jobcount_color()
if [ $running != "0" -a $stopped != "0" ]
then
rep="${NO_COL}[${YELLOW}${running}r${NO_COL}/${LIGHT_YELLOW}${stopped}s${NO_COL}]"
rep="${NO_COL}${YELLOW}${running}r${NO_COL}/${LIGHT_YELLOW}${stopped}s${NO_COL} "
elif [ $running != "0" -a $stopped == "0" ]
then
rep="${NO_COL}[${YELLOW}${running}r${NO_COL}]"
rep="${NO_COL}${YELLOW}${running}r${NO_COL} "
elif [ $running == "0" -a $stopped != "0" ]
then
rep="${NO_COL}[${LIGHT_YELLOW}${stopped}s${NO_COL}]"
rep="${NO_COL}${LIGHT_YELLOW}${stopped}s${NO_COL} "
fi
echo -ne "$rep"
}
@ -189,7 +189,8 @@ __git_branch_color()
fi
if [ "$GD" -eq 1 -o "$GDC" -eq "1" ]; then
if [ "$has_commit" -gt "0" ] ; then
ret=" ${RED}${branch}${NO_COL}(${YELLOW}$has_commit${NO_COL})" # changes to commit and commits to push
# changes to commit and commits to push
ret=" ${RED}${branch}${NO_COL}(${YELLOW}$has_commit${NO_COL}) "
else
ret=" ${RED}${branch}${NO_COL} " # changes to commit
fi
@ -237,7 +238,7 @@ __battery_color()
return; # nothing displayed above 75%
fi
ret="${NO_COL}[battery="
ret="b${NO_COL}"
if [ ${bat} -le 75 ] && [ ${bat} -gt 50 ] ; then
ret="${ret}${LIGHT_GREEN} "
elif [ ${bat} -le 40 ] && [ ${bat} -gt 20 ] ; then
@ -250,7 +251,7 @@ __battery_color()
ret="${ret}${CRIT_RED} "
fi
echo -ne "${ret}${bat}%${NO_COL}]"
echo -ne "${ret}${bat}%${NO_COL}"
fi
}
@ -285,7 +286,7 @@ __load_color()
if [ "$load" -ge "60" ]
then
ret="${NO_COL}["
ret="l${NO_COL}"
if [ $load -lt 70 ] ; then
ret="${ret}${LIGHT_GREY} "
elif [ $load -ge 1 ] && [ $load -lt 80 ] ; then
@ -299,7 +300,7 @@ __load_color()
else
ret="${ret}${CRIT_RED} "
fi
ret="${ret}cpu=$load%${NO_COL}]"
ret="${ret}$load%${NO_COL} "
echo -ne "${ret}"
fi
}
@ -312,12 +313,12 @@ __smart_mark()
git log -1 >/dev/null 2>&1
if [ "$?" -eq "0" ]
then
echo -n '±'
echo -ne "${WHITE}±${NO_COL}"
else
echo -n '$'
echo -ne "${WHITE}\\\$${NO_COL}"
fi
else
echo -n '#'
echo -ne "${RED}#${NO_COL}"
fi
}
@ -325,7 +326,7 @@ __return_value()
{
if [ "$1" -ne "0" ]
then
echo -ne "${NO_COL}[${PURPLE}\\\$?=$1${NO_COL}]"
echo -ne "${NO_COL}${PURPLE}$1${NO_COL} "
fi
}
@ -341,10 +342,10 @@ __set_bash_prompt()
PS1="${__BATT}${__LOAD}${__JOBS}"
if [ "$EUID" -ne "0" ]
then
PS1="${PS1}${LIGHT_GREEN}\u${__HOST}${NO_COL}:${LIGHT_BLUE}\w${NO_COL}"
PS1="${PS1}[${LIGHT_GREY}\u${NO_COL}${__HOST}:${WHITE}\w${NO_COL}]"
PS1="${PS1}${__GIT}"
else
PS1="${PS1}${LIGHT_RED}\u${__HOST}${NO_COL}:${LIGHT_BLUE}\w${NO_COL}"
PS1="${PS1}${LIGHT_YELLOW}\u${__HOST}${NO_COL}:${YELLOW}\w${NO_COL}"
fi
PS1="${PS1}${__RETURN}${__PROMPT} "