add hostname prefix via MYHOSTEXPRESSION
This commit is contained in:
parent
bf25c8e1d2
commit
8375ca971f
1 changed files with 15 additions and 1 deletions
16
prompt.zsh
16
prompt.zsh
|
@ -56,6 +56,20 @@ function promptSetup () {
|
||||||
CURRENT_USER=`whoami`
|
CURRENT_USER=`whoami`
|
||||||
PR_SIGN=$NOCOLOR
|
PR_SIGN=$NOCOLOR
|
||||||
PR_SIGN+="%F{160}%B"
|
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
|
if [[ $CURRENT_USER == 'root' ]]; then
|
||||||
PR_SIGN+="☠"
|
PR_SIGN+="☠"
|
||||||
elif [[ $CURRENT_USER == 'vagrant' ]]; then
|
elif [[ $CURRENT_USER == 'vagrant' ]]; then
|
||||||
|
@ -63,7 +77,7 @@ function promptSetup () {
|
||||||
else
|
else
|
||||||
PR_SIGN+="∴"
|
PR_SIGN+="∴"
|
||||||
fi
|
fi
|
||||||
#PR_SIGN+=%(#."☠".'∴')
|
|
||||||
PR_SIGN+="%F{white}%b"
|
PR_SIGN+="%F{white}%b"
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue