trusting default shell colors

supressing config option in configuration file
This commit is contained in:
François Schmidts 2012-08-14 00:56:27 +02:00
parent 3abc3999dd
commit 21808bb5e2
2 changed files with 6 additions and 27 deletions

View File

@ -131,10 +131,7 @@ esac
# Colors declarations # Colors declarations
if [[ "$LP_OS" == "FreeBSD" ]] ; then if [[ "$LP_OS" == "FreeBSD" ]] ; then
BLACK="${_LP_OPEN_ESC}$(tput AF 0)${_LP_CLOSE_ESC}" BOLD="${_LP_OPEN_ESC}$(tput md)${_LP_CLOSE_ESC}"
BOLD_GRAY="${_LP_OPEN_ESC}$(tput md ; tput AF 0)${_LP_CLOSE_ESC}"
WHITE="${_LP_OPEN_ESC}$(tput AF 7)${_LP_CLOSE_ESC}"
BOLD_WHITE="${_LP_OPEN_ESC}$(tput md ; tput AF 7)${_LP_CLOSE_ESC}"
RED="${_LP_OPEN_ESC}$(tput AF 1)${_LP_CLOSE_ESC}" RED="${_LP_OPEN_ESC}$(tput AF 1)${_LP_CLOSE_ESC}"
BOLD_RED="${_LP_OPEN_ESC}$(tput md ; tput AF 1)${_LP_CLOSE_ESC}" BOLD_RED="${_LP_OPEN_ESC}$(tput md ; tput AF 1)${_LP_CLOSE_ESC}"
@ -160,10 +157,7 @@ if [[ "$LP_OS" == "FreeBSD" ]] ; then
else else
# default to Linux # default to Linux
BLACK="${_LP_OPEN_ESC}$(tput setaf 0)${_LP_CLOSE_ESC}" BOLD="${_LP_OPEN_ESC}$(tput bold)${_LP_CLOSE_ESC}"
BOLD_GRAY="${_LP_OPEN_ESC}$(tput bold ; tput setaf 0)${_LP_CLOSE_ESC}"
WHITE="${_LP_OPEN_ESC}$(tput setaf 7)${_LP_CLOSE_ESC}"
BOLD_WHITE="${_LP_OPEN_ESC}$(tput bold ; tput setaf 7)${_LP_CLOSE_ESC}"
RED="${_LP_OPEN_ESC}$(tput setaf 1)${_LP_CLOSE_ESC}" RED="${_LP_OPEN_ESC}$(tput setaf 1)${_LP_CLOSE_ESC}"
BOLD_RED="${_LP_OPEN_ESC}$(tput bold ; tput setaf 1)${_LP_CLOSE_ESC}" BOLD_RED="${_LP_OPEN_ESC}$(tput bold ; tput setaf 1)${_LP_CLOSE_ESC}"
@ -189,16 +183,6 @@ else
fi fi
# Foreground colors
# can be set to white or black
FG=$WHITE
BOLD_FG=$BOLD_WHITE
if [[ $LP_REVERSE == 1 ]] ; then
FG=$BLACK
BOLD_FG=$BOLD_GRAY
fi
# get cpu number # get cpu number
_lp_cpunum_Linux() _lp_cpunum_Linux()
{ {
@ -264,7 +248,7 @@ _lp_user()
if [[ "$EUID" -ne "0" ]] ; then if [[ "$EUID" -ne "0" ]] ; then
# if user is not login user # if user is not login user
if [[ ${USER} != "$(logname 2>/dev/null)" ]]; then if [[ ${USER} != "$(logname 2>/dev/null)" ]]; then
user="${FG}${_LP_USER_SYMBOL}${NO_COL}" user="${_LP_USER_SYMBOL}${NO_COL}"
else else
user="${_LP_USER_SYMBOL}" user="${_LP_USER_SYMBOL}"
fi fi
@ -801,7 +785,7 @@ _lp_load_color()
local ret local ret
ret="${LP_LOAD_MARK}${NO_COL}" ret="${LP_LOAD_MARK}${NO_COL}"
if [[ $load -lt 70 ]] ; then if [[ $load -lt 70 ]] ; then
ret="${ret}${FG}" ret="${ret}"
elif [[ $load -ge 1 ]] && [[ $load -lt 80 ]] ; then elif [[ $load -ge 1 ]] && [[ $load -lt 80 ]] ; then
ret="${ret}${BOLD_GREEN}" ret="${ret}${BOLD_GREEN}"
elif [[ $load -ge 80 ]] && [[ $load -lt 95 ]] ; then elif [[ $load -ge 80 ]] && [[ $load -lt 95 ]] ; then
@ -832,7 +816,7 @@ _lp_load_color()
_lp_smart_mark() _lp_smart_mark()
{ {
local COL local COL
COL=${BOLD_FG} COL=${BOLD}
if [[ "$EUID" -eq "0" ]] ; then if [[ "$EUID" -eq "0" ]] ; then
COL=${BOLD_RED} COL=${BOLD_RED}
fi fi
@ -919,7 +903,7 @@ _lp_set_bash_prompt()
if [[ "$EUID" -ne "0" ]] if [[ "$EUID" -ne "0" ]]
then then
# path in foreground color # path in foreground color
PS1="${PS1}${BOLD_FG}${LP_PWD}${NO_COL}]${LP_PROXY}" PS1="${PS1}${BOLD}${LP_PWD}${NO_COL}]${LP_PROXY}"
# add VCS infos # add VCS infos
PS1="${PS1}${LP_GIT}${LP_HG}${LP_SVN}" PS1="${PS1}${LP_GIT}${LP_HG}${LP_SVN}"
else else

View File

@ -19,11 +19,6 @@ LP_PATH_LENGTH=35
# Recommended value is 2 # Recommended value is 2
LP_PATH_KEEP=2 LP_PATH_KEEP=2
# Do we use reverse colors (black on white) instead of normal theme (white on black)
# Defaults to 0 (normal colors)
# set to 1 if you use black on white
LP_REVERSE=0
# Do you want to display the hostname, even if not connected through network? # Do you want to display the hostname, even if not connected through network?
# Defaults to 0 (do not display hostname when localy connected) # Defaults to 0 (do not display hostname when localy connected)
# set to 1 if you want to always see the hostname # set to 1 if you want to always see the hostname