summaryrefslogtreecommitdiffstats
path: root/bashrc/common
diff options
context:
space:
mode:
Diffstat (limited to 'bashrc/common')
-rw-r--r--bashrc/common/prompt.sh15
1 files changed, 7 insertions, 8 deletions
diff --git a/bashrc/common/prompt.sh b/bashrc/common/prompt.sh
index cc57e38..71e0598 100644
--- a/bashrc/common/prompt.sh
+++ b/bashrc/common/prompt.sh
@@ -11,15 +11,10 @@ __make_prompt() {
_hostname=$(hostname)
# username + nodename
- [[ $(id -nu) == "alex" ]] || user="\u"
+ [[ $(id -nu) == "alex" || $(id -u) -eq 0 ]] || user="\u"
[[ "${_hostname}" == "laptop" ]] || host="@${_hostname}"
[[ -z "$user" && -z "$host" ]] || host="${host} "
-
- if [[ $(id -u) -eq 0 ]]; then
- PS1UH="$(pcolor lred)${user}${host}$(pcolor)"
- else
- PS1UH="$(pcolor lcyan)${user}${host}$(pcolor)"
- fi
+ PS1UH="$(pcolor lcyan)${user}${host}$(pcolor)"
# working directory
PS1D="$(pcolor lpurple)$(pwd -P)$(pcolor)"
@@ -38,7 +33,11 @@ __make_prompt() {
[[ -n "${VIRTUAL_ENV}" ]] && PS1VE="$(pcolor lred)<${VIRTUAL_ENV#${WORKON_HOME}/}>$(pcolor) "
# prompt character
- PS1P="$(pcolor lblue)\\\$ $(pcolor)"
+ if [[ $(id -u) -eq 0 ]]; then
+ PS1P="$(pcolor lred)\\\$ $(pcolor)"
+ else
+ PS1P="$(pcolor lblue)\\\$ $(pcolor)"
+ fi
# open/closing brackets
PS1BO="$(pcolor lgray)[$(pcolor)"