summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--bashrc/common/prompt.sh13
1 files changed, 7 insertions, 6 deletions
diff --git a/bashrc/common/prompt.sh b/bashrc/common/prompt.sh
index d1efebe..ddb2679 100644
--- a/bashrc/common/prompt.sh
+++ b/bashrc/common/prompt.sh
@@ -10,14 +10,15 @@ __make_prompt() {
local PS1UH PS1D PS1R PS1F PS1P PS1BO PS1BC PS1VE user host rc=$? s
# username + nodename
+ [[ $USER == "alex" ]] || user="\u"
+ [[ $HOSTNAME == "laptop" ]] || host="\h"
+ [[ -n "$user" && -n "$host" ]] && user="${user}@"
+ [[ -z "$user" && -z "$host" ]] || host="${host} "
+
if [[ $(id -u) -eq 0 ]]; then
- PS1UH="$(pcolor lred)\h$(pcolor)"
+ PS1UH="$(pcolor lred)${user}${host}$(pcolor) "
else
- [[ $USER == "alex" ]] || user="\u"
- [[ $HOSTNAME == "laptop" ]] || host="\h"
- [[ -n "$user" && -n "$host" ]] && user="${user}@"
- [[ -z "$user" && -z "$host" ]] || host="${host} "
- PS1UH="$(pcolor lgreen)${user}${host}$(pcolor)"
+ PS1UH="$(pcolor lgreen)${user}${host}$(pcolor) "
fi
# working directory