Changes to support Macs
authorAndrew DeFaria <Andrew@DeFaria.com>
Thu, 19 May 2016 18:03:23 +0000 (11:03 -0700)
committerAndrew DeFaria <Andrew@DeFaria.com>
Thu, 19 May 2016 18:03:23 +0000 (11:03 -0700)
rc/bash_login
rc/functions
rc/set_colors
rc/sshconfig

index 679307f..8e47493 100644 (file)
@@ -215,13 +215,14 @@ fi
 
 #alias grep="grep -d skip"
 
-if [ "$TERM" = "hpterm"    -o \
-     "$TERM" = "hp"        -o \
-     "$TERM" = "dtterm"    -o \
-     "$TERM" = "sun-color" -o \
-     "$TERM" = "vt100"     -o \
-     "$TERM" = "vt220"     -o \
-     "$TERM" = "xterm"     -o \
+if [ "$TERM" = "hpterm"         -o \
+     "$TERM" = "hp"             -o \
+     "$TERM" = "dtterm"         -o \
+     "$TERM" = "sun-color"      -o \
+     "$TERM" = "vt100"          -o \
+     "$TERM" = "vt220"          -o \
+     "$TERM" = "xterm"          -o \
+     "$TERM" = "xterm-256color" -o \
      "$TERM" = "cygwin" ]; then
   alias cd=mycd
   alias pushd=mypushd
index 6b42f09..059d7cc 100644 (file)
@@ -23,9 +23,8 @@ function title_bar {
     ROOT=shift
     ROOT="${NORMAL}\($ROOT\)"
   fi
-
+  
   prefix="$@"
-
   # Change $HOME -> ~
   if [ "${PWD#$HOME*}" != "$PWD" ]; then
     current_dir="~${PWD#$HOME*}"
@@ -58,9 +57,11 @@ function title_bar {
         "$TERM" = "vt221" ]; then
     string=$(echo "${SYSNAME##*:}:$@")
     echo -n "${ESC}]2;$string\007"
-  elif [ "$TERM" = "cygwin" -o "$TERM" = "vt100" -o "$TERM" = "xterm" ]; then
-    # Here's where we set the prompt with root
-    PS1="\[\e]0;$prefix$current_dir\a$AQUA\]$ROOT\[$YELLOW\]$SYSNAME:\[$NORMAL\]"
+  elif [ "$TERM" = "cygwin" -o \
+         "$TERM" = "vt100"  -o \
+         "$TERM" = "xterm"  -o \
+         "$TERM" = "xterm-256color" ]; then
+    PS1="\[\e]0;$prefix$current_dir\a\[$RED\]$ROOT\[$LIGHT_CYAN\]$SYSNAME:\[$WHITE\]"
   fi
 } # title_bar
 
@@ -103,7 +104,7 @@ function set_title {
     view_name=""
     title_bar "$ROOT"
   else
-    title_bar "$ROOT" "View: $view_name: "
+    title_bar "${ROOT}View: $view_name: "
   fi
 
   icon_name "${SYSNAME##*:}"
@@ -118,17 +119,19 @@ function set_prompt {
          "$TERM"   = "dtterm" -o \
          ! -z "$DTTERM" ]; then
       ROOT="${RED}Wizard$NORMAL "
-    elif [ "$TERM" = "vt100" -o \
-           "$TERM" = "xterm" -o \
-          "$TERM" = "vt220" ]; then
+    elif [ "$TERM" = "vt100"          -o \
+           "$TERM" = "xterm"          -o \
+           "$TERM" = "xterm-256color" -o \
+           "$TERM" = "vt220" ]; then
       ROOT="${BOLD}${BLINK}Wizard$NORMAL "
     fi
   else
     ROOT=""
   fi
 
-  if [ "$TERM" = "vt100" -o \
-       "$TERM" = "xterm" -o \
+  if [ "$TERM" = "vt100"          -o \
+       "$TERM" = "xterm"          -o \
+       "$TERM" = "xterm-256color" -o \
        "$TERM" = "vt220" ]; then
     PS1="$ROOT$BOLD$SYSNAME:$NORMAL"
   else
index 8681d99..7c991a3 100644 (file)
@@ -16,12 +16,13 @@ esc=$(echo "\033")
 
 if [ "$TERM" = "vt100" -o \
      "$TERM" = "vt220" ]; then
-  NORMAL="$esc[0m"
-  BOLD="$esc[1m"
-  UNDERLINE="$esc[4m"
-  BLINK="$esc[5m"
-  INVERSE="$esc[7m"
-elif [ "$TERM" = "dtterm" -o "$TERM" = "vt100" -o "$TERM" = "xterm" -o -z DTTERM ]; then
+     NORMAL="$esc[0m"
+     BOLD="$esc[1m"
+     UNDERLINE="$esc[4m"
+     BLINK="$esc[5m"
+     INVERSE="$esc[7m"
+elif [ "$TERM" = "dtterm" -o \
+       "$TERM" = "xterm"     ]; then
   NORMAL="$esc[39m"
   RED="$esc[31m"
   B_RED=$RED
@@ -37,6 +38,23 @@ elif [ "$TERM" = "dtterm" -o "$TERM" = "vt100" -o "$TERM" = "xterm" -o -z DTTERM
   B_AQUA=$AQUA
   WHITE="$esc[36m"
   B_WHITE=$WHITE
+elif [ "$TERM" = "xterm-256color" ]; then
+  NORMAL="$esc[39m"
+  BLACK="$esc[30m"
+  RED="$esc[31m"
+  GREEN="$esc[32m"
+  YELLOW="$esc[33m"
+  BLUE="$esc[34m"
+  MAGENTA="$esc[35m"
+  CYAN="$esc[36m"
+  LIGHT_GRAY="$esc[37m"
+  DARK_GRAY="$esc[90m"
+  LIGHT_RED="$esc[91m"
+  LIGHT_GREEN="$esc[92m"
+  LIGHT_YELLOW="$esc[93m"
+  LIGHT_MAGENTA="$esc[94m"
+  LIGHT_CYAN="$esc[96m"
+  WHITE="$esc[97m"
 elif [ "$TERM" = "hp" -o "$TERM" = "hpterm" ]; then
   NORMAL="$esc&d@$esc&v0S"
   RED="$esc&v1S"
index 965139e..a49bcad 100644 (file)
@@ -12,6 +12,7 @@ Host home
 
 Host defaria.com
   User andrew
+  IdentityFile         ~/.ssh/id_ecdsa
 
 Host *
   User adefaria