Change all hostname calls for $HOST or $SHORT_HOST

This commit is contained in:
Marc Cornellà 2014-10-09 17:05:48 +02:00
parent 4310a15de5
commit 95d795e8ca
8 changed files with 8 additions and 8 deletions

View File

@ -2,7 +2,7 @@
# This will look for a custom profile for the local machine and each domain or # 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) # 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 for i in {${#parts}..1}; do
profile=${(j:.:)${parts[$i,${#parts}]}} profile=${(j:.:)${parts[$i,${#parts}]}}
file=$ZSH_CUSTOM/profiles/$profile file=$ZSH_CUSTOM/profiles/$profile

View File

@ -13,7 +13,7 @@ patches: <patches|join( → )|pre_applied(%{$fg[yellow]%})|post_applied(%{$reset
} }
function box_name { function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || hostname -s [ -f ~/.box-name ] && cat ~/.box-name || echo $SHORT_HOST || echo $HOST
} }
PROMPT=' PROMPT='

View File

@ -21,7 +21,7 @@ local user="%(!.%{$fg[blue]%}.%{$fg[blue]%})%n%{$reset_color%}"
# Hostname part. compressed and colorcoded per host_repr array # Hostname part. compressed and colorcoded per host_repr array
# if not found, regular hostname in default color # 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 # Compacted $PWD
local pwd="%{$fg[blue]%}%c%{$reset_color%}" local pwd="%{$fg[blue]%}%c%{$reset_color%}"

View File

@ -21,7 +21,7 @@ function prompt_char {
} }
function box_name { function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || hostname -s [ -f ~/.box-name ] && cat ~/.box-name || echo $SHORT_HOST || echo $HOST
} }

View File

@ -17,7 +17,7 @@ function prompt_char {
} }
function box_name { 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='' local ruby_env=''

View File

@ -1,7 +1,7 @@
# Simple theme based on my old zsh settings. # Simple theme based on my old zsh settings.
function get_host { function get_host {
echo '@'`hostname`'' echo '@'$HOST
} }
PROMPT='> ' PROMPT='> '

View File

@ -17,7 +17,7 @@ USERNAME_NORMAL_COLOR=$WHITE
USERNAME_ROOT_COLOR=$RED USERNAME_ROOT_COLOR=$RED
HOSTNAME_NORMAL_COLOR=$BLUE HOSTNAME_NORMAL_COLOR=$BLUE
# uncomment next line if you want auto-generated hostname color # 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_ROOT_COLOR=$RED
HOSTNAME_COLOR=%(!.$HOSTNAME_ROOT_COLOR.$HOSTNAME_NORMAL_COLOR) HOSTNAME_COLOR=%(!.$HOSTNAME_ROOT_COLOR.$HOSTNAME_NORMAL_COLOR)
CURRENT_DIR_COLOR=$CYAN CURRENT_DIR_COLOR=$CYAN

View File

@ -8,7 +8,7 @@
# Machine name. # Machine name.
function box_name { function box_name {
[ -f ~/.box-name ] && cat ~/.box-name || hostname [ -f ~/.box-name ] && cat ~/.box-name || echo $HOST
} }
# Directory info. # Directory info.