it doesn't seem that LP_USER need to be defined at each prompt set
This commit is contained in:
parent
102392f4e0
commit
5b247e3d82
32
liquidprompt
32
liquidprompt
@ -307,27 +307,20 @@ unset _lp_source_config
|
|||||||
###############
|
###############
|
||||||
|
|
||||||
# Yellow for root, bold if the user is not the login one, else no color.
|
# Yellow for root, bold if the user is not the login one, else no color.
|
||||||
_lp_user()
|
if [[ "$EUID" -ne "0" ]] ; then # if user is not root
|
||||||
{
|
# if user is not login user
|
||||||
local user
|
if [[ ${USER} != "$(logname 2>/dev/null)" ]]; then
|
||||||
# if user is not root
|
LP_USER="${LP_COLOR_USER_ALT}${_LP_USER_SYMBOL}${NO_COL}"
|
||||||
if [[ "$EUID" -ne "0" ]] ; then
|
|
||||||
# if user is not login user
|
|
||||||
if [[ ${USER} != "$(logname 2>/dev/null)" ]]; then
|
|
||||||
user="${LP_COLOR_USER_ALT}${_LP_USER_SYMBOL}${NO_COL}"
|
|
||||||
else
|
|
||||||
if [[ "${LP_USER_ALWAYS}" -ne "0" ]] ; then
|
|
||||||
user="${LP_COLOR_USER_LOGGED}${_LP_USER_SYMBOL}${NO_COL}"
|
|
||||||
else
|
|
||||||
user=""
|
|
||||||
fi
|
|
||||||
fi
|
|
||||||
else
|
else
|
||||||
user="${LP_COLOR_USER_ROOT}${_LP_USER_SYMBOL}${NO_COL}"
|
if [[ "${LP_USER_ALWAYS}" -ne "0" ]] ; then
|
||||||
|
LP_USER="${LP_COLOR_USER_LOGGED}${_LP_USER_SYMBOL}${NO_COL}"
|
||||||
|
else
|
||||||
|
LP_USER=""
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
echo -ne $user
|
LP_USER="${LP_COLOR_USER_ROOT}${_LP_USER_SYMBOL}${NO_COL}"
|
||||||
}
|
fi
|
||||||
|
|
||||||
|
|
||||||
#################
|
#################
|
||||||
@ -1219,7 +1212,6 @@ _lp_set_prompt()
|
|||||||
LP_TIME=$(_lp_sr "$(_lp_time)")
|
LP_TIME=$(_lp_sr "$(_lp_time)")
|
||||||
|
|
||||||
# in main prompt: no space
|
# in main prompt: no space
|
||||||
LP_USER=$(_lp_user)
|
|
||||||
LP_PROXY="$(_lp_proxy)"
|
LP_PROXY="$(_lp_proxy)"
|
||||||
|
|
||||||
# right of main prompt: space at left
|
# right of main prompt: space at left
|
||||||
|
Loading…
x
Reference in New Issue
Block a user