diff options
-rw-r--r-- | zsh/.zshrc | 21 |
1 files changed, 16 insertions, 5 deletions
@@ -91,6 +91,15 @@ stty -ixon # enable mapping of C-s in vim.. autoload -U colors && colors +in_google_cloud () { + curl metadata.google.internal -i &>/dev/null + if [[ $? -eq 0 ]]; then + echo "yes" + else + echo "no" + fi +} + # possible colors: black, white, green, cyan, red, yellow, magenta case `hostname` in bogues*|curry*|iverson*|jordan*|ming*|nowitzki*|oneal*|robinson*) @@ -101,11 +110,7 @@ case `hostname` in HOSTCOLOR_BG=blue HOSTCOLOR_FG=black ;; - ip-*) - HOSTCOLOR_BG=cyan - HOSTCOLOR_FG=black - ;; - 2pac|coltrane|donna|vicious|lemmy|CLuster|node*|gpu*) + 2pac|coltrane|donna|vicious|lemmy|CLuster) HOSTCOLOR_BG=green HOSTCOLOR_FG=black ;; @@ -115,6 +120,12 @@ case `hostname` in ;; esac +# google cloud +if [[ $(in_google_cloud) == "yes" ]]; then + HOSTCOLOR_BG=cyan + HOSTCOLOR_FG=white +fi + function chpwd { if [[ -e $ZDIR/functions ]] { |