summaryrefslogtreecommitdiffstats
path: root/bashrc/common
diff options
context:
space:
mode:
authorAlexander Sulfrian <alexander@sulfrian.net>2012-01-11 05:49:52 +0100
committerAlexander Sulfrian <alexander@sulfrian.net>2012-01-11 05:49:52 +0100
commit4fb79ff9ccc2a1c3fe79931e4333e68cafb36dd9 (patch)
treeb38d73d054549128b4374ddc1ac5234fd468b9aa /bashrc/common
parent9ee24479c2b6a21e4cdfebd77d0f2e0560682692 (diff)
downloaddotfiles-4fb79ff9ccc2a1c3fe79931e4333e68cafb36dd9.tar.gz
dotfiles-4fb79ff9ccc2a1c3fe79931e4333e68cafb36dd9.tar.xz
dotfiles-4fb79ff9ccc2a1c3fe79931e4333e68cafb36dd9.zip
prompt: fixed spacing after host as root
Diffstat (limited to 'bashrc/common')
-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