Change all hostname calls for $HOST or $SHORT_HOST
This commit is contained in:
parent
4310a15de5
commit
95d795e8ca
@ -2,7 +2,7 @@
|
||||
|
||||
# This will look for a custom profile for the local machine and each domain or
|
||||
# subdomain it belongs to. (e.g. com, example.com and foo.example.com)
|
||||
parts=(${(s:.:)$(hostname)})
|
||||
parts=(${(s:.:)$HOST})
|
||||
for i in {${#parts}..1}; do
|
||||
profile=${(j:.:)${parts[$i,${#parts}]}}
|
||||
file=$ZSH_CUSTOM/profiles/$profile
|
||||
|
@ -13,7 +13,7 @@ patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset
|
||||
}
|
||||
|
||||
function box_name {
|
||||
[ -f ~/.box-name ] && cat ~/.box-name || hostname -s
|
||||
[ -f ~/.box-name ] && cat ~/.box-name || echo $SHORT_HOST || echo $HOST
|
||||
}
|
||||
|
||||
PROMPT='
|
||||
|
@ -21,7 +21,7 @@ local user="%(!.%{$fg[blue]%}.%{$fg[blue]%})%n%{$reset_color%}"
|
||||
|
||||
# Hostname part. compressed and colorcoded per host_repr array
|
||||
# if not found, regular hostname in default color
|
||||
local host="@${host_repr[$(hostname)]:-$(hostname)}%{$reset_color%}"
|
||||
local host="@${host_repr[$HOST]:-$HOST}%{$reset_color%}"
|
||||
|
||||
# Compacted $PWD
|
||||
local pwd="%{$fg[blue]%}%c%{$reset_color%}"
|
||||
|
@ -21,7 +21,7 @@ function prompt_char {
|
||||
}
|
||||
|
||||
function box_name {
|
||||
[ -f ~/.box-name ] && cat ~/.box-name || hostname -s
|
||||
[ -f ~/.box-name ] && cat ~/.box-name || echo $SHORT_HOST || echo $HOST
|
||||
}
|
||||
|
||||
|
||||
|
@ -17,7 +17,7 @@ function prompt_char {
|
||||
}
|
||||
|
||||
function box_name {
|
||||
[ -f ~/.box-name ] && cat ~/.box-name || hostname -s
|
||||
[ -f ~/.box-name ] && cat ~/.box-name || echo $SHORT_HOST || echo $HOST
|
||||
}
|
||||
|
||||
local ruby_env=''
|
||||
|
@ -1,7 +1,7 @@
|
||||
# Simple theme based on my old zsh settings.
|
||||
|
||||
function get_host {
|
||||
echo '@'`hostname`''
|
||||
echo '@'$HOST
|
||||
}
|
||||
|
||||
PROMPT='> '
|
||||
|
@ -17,7 +17,7 @@ USERNAME_NORMAL_COLOR=$WHITE
|
||||
USERNAME_ROOT_COLOR=$RED
|
||||
HOSTNAME_NORMAL_COLOR=$BLUE
|
||||
# uncomment next line if you want auto-generated hostname color
|
||||
#for i in `hostname`; HOSTNAME_NORMAL_COLOR=$COLOR_ARRAY[$[((#i))%7+1]]
|
||||
#for i in $HOST; HOSTNAME_NORMAL_COLOR=$COLOR_ARRAY[$[((#i))%7+1]]
|
||||
HOSTNAME_ROOT_COLOR=$RED
|
||||
HOSTNAME_COLOR=%(!.$HOSTNAME_ROOT_COLOR.$HOSTNAME_NORMAL_COLOR)
|
||||
CURRENT_DIR_COLOR=$CYAN
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
# Machine name.
|
||||
function box_name {
|
||||
[ -f ~/.box-name ] && cat ~/.box-name || hostname
|
||||
[ -f ~/.box-name ] && cat ~/.box-name || echo $HOST
|
||||
}
|
||||
|
||||
# Directory info.
|
||||
|
Loading…
Reference in New Issue
Block a user