Explorar el Código

add color variables

pull/1/head
10sr hace 11 años
padre
commit
31f2db4e03
Se han modificado 1 ficheros con 48 adiciones y 9 borrados
  1. +48
    -9
      shrc

+ 48
- 9
shrc Ver fichero

@@ -1185,18 +1185,57 @@ __my_alert_fail(){
test $laststatus -eq 0 || echo '!!! '
}

__attr_beg='\[\033['
__attr_end='m\]'

__color_default="${__attr_beg}0${__attr_end}"

__color_black="${__attr_beg}0;30${__attr_end}"
__color_red="${__attr_beg}0;31${__attr_end}"
__color_green="${__attr_beg}0;32${__attr_end}"
__color_brown="${__attr_beg}0;33${__attr_end}"
__color_blue="${__attr_beg}0;34${__attr_end}"
__color_purple="${__attr_beg}0;35${__attr_end}"
__color_cyan="${__attr_beg}0;36${__attr_end}"
__color_light_gray="${__attr_beg}0;37${__attr_end}"

__color_dark_gray="${__attr_beg}1;30${__attr_end}"
__color_light_red="${__attr_beg}1;31${__attr_end}"
__color_light_green="${__attr_beg}1;32${__attr_end}"
__color_yellow="${__attr_beg}1;33${__attr_end}"
__color_light_blue="${__attr_beg}1;34${__attr_end}"
__color_light_purple="${__attr_beg}1;35${__attr_end}"
__color_light_cyan="${__attr_beg}1;36${__attr_end}"
__color_white="${__attr_beg}1;37${__attr_end}"

__color_bg_black="${__attr_beg}40${__attr_end}"
__color_bg_red="${__attr_beg}41${__attr_end}"
__color_bg_green="${__attr_beg}42${__attr_end}"
__color_bg_brown="${__attr_beg}43${__attr_end}"
__color_bg_blue="${__attr_beg}44${__attr_end}"
__color_bg_purple="${__attr_beg}45${__attr_end}"
__color_bg_cyan="${__attr_beg}46${__attr_end}"
__color_bg_light_gray="${__attr_beg}47${__attr_end}"

__attr_underline="${__attr_beg}4${__attr_end}"
__attr_reverse="${__attr_beg}7${__attr_end}"

# NOTE: tput is another easy way to set colors and background
# For example, "$(tput setab 4)text$(tput sgr0)" print text with background
# color blue.

if test "$TERM" != dumb
then
__my_c1='\[\033[0;33m\]' # color for PWD
__my_c2='\[\033[0;36m\]' # color for user
__my_c3='\[\033[1;30m\]' # color for OLDPWD
if test "`hostname`" = arch-aspireone; then __my_c4='\[\033[1;34m\]'
elif test "`hostname`" = darwin-mba.local; then __my_c4='\[\033[1;31m\]'
elif test "`hostname`" = newkiwi; then __my_c4='\[\033[1;35m\]'
else __my_c4='\[\033[1;32m\]' # color for ::
__my_c1="$__color_brown" # color for PWD
__my_c2="$__color_cyan" # color for user and hostname
# color for ::
if test "`hostname`" = arch-aspireone; then __my_c4="$__color_light_blue"
elif test "`hostname`" = darwin-mba.local; then __my_c4="$__color_light_red"
elif test "`hostname`" = newkiwi; then __my_c4="$__color_light_purple"
else __my_c4="$__color_light_green"
fi
__my_c5='\[\033[30;47m\]' # color for SCR
__my_cdef='\[\033[0m\]'
__my_c5="$__color_black$__color_bg_light_gray" # color for SCR
__my_cdef="$__color_default"
fi

_ps1_bash="\


Cargando…
Cancelar
Guardar