add hostname prefix via MYHOSTEXPRESSION

master
Sebastian Tramp 2012-08-23 19:24:38 +02:00
parent bf25c8e1d2
commit 8375ca971f
No known key found for this signature in database
GPG Key ID: E8093B579D601B44
1 changed files with 15 additions and 1 deletions

View File

@ -56,6 +56,20 @@ function promptSetup () {
CURRENT_USER=`whoami`
PR_SIGN=$NOCOLOR
PR_SIGN+="%F{160}%B"
# prepend the hostname if we are outside
if [[ "$MYHOSTEXPRESSION" == "" ]]; then
# if not set, home is nowhere
MYHOSTEXPRESSION="^$"
fi
if [[ "`hostname`" =~ "$MYHOSTEXPRESSION" ]]; then
# we are on our home desktop
else
# we are outside on a server
PR_SIGN+="`hostname` "
fi
# setup the main sign
if [[ $CURRENT_USER == 'root' ]]; then
PR_SIGN+="☠"
elif [[ $CURRENT_USER == 'vagrant' ]]; then
@ -63,7 +77,7 @@ function promptSetup () {
else
PR_SIGN+="∴"
fi
#PR_SIGN+=%(#."☠".'∴')
PR_SIGN+="%F{white}%b"