diff options
-rw-r--r-- | 10_Environment.zsh | 2 | ||||
-rw-r--r-- | 12_Prompts.zsh | 3 | ||||
-rw-r--r-- | net:foret/Functions.zsh | 34 | ||||
-rw-r--r-- | zshrc | 5 |
4 files changed, 40 insertions, 4 deletions
diff --git a/10_Environment.zsh b/10_Environment.zsh index 658b362..ce82154 100644 --- a/10_Environment.zsh +++ b/10_Environment.zsh @@ -94,7 +94,7 @@ HISTSIZE=$(( $SAVEHIST * 1.10 )) export GPG_TTY=`tty` # YeahConsole.. -if ( ps x | grep $$ -B1 | grep -q yeahconsole ) +if ( ps x 2>&- | grep $$ -B1 | grep -q yeahconsole ) then _yeahconsole=true fi diff --git a/12_Prompts.zsh b/12_Prompts.zsh index 37adec5..61db556 100644 --- a/12_Prompts.zsh +++ b/12_Prompts.zsh @@ -329,7 +329,8 @@ __two_lines_prompt () PS1_+=$(__show_date) PS1_+=" -"$C_$_prompt_colors[user]$_C"${USER:-%n}"$C_$_prompt_colors[arob]$_C"@"$C_$_prompt_colors[host]$_C"%M${SSH_CLIENT:+ ← $(host ${SSH_CLIENT/ */} | awk '{ gsub(/\.$/, "", $NF); gsub(/.'$DOMAIN'$/, "", $NF); print $NF }')} "$CURDIR${VCSBRANCH:+ $VCSBRANCH} +"$C_$_prompt_colors[user]$_C"${USER:-%n}"$C_$_prompt_colors[arob]$_C"@"$C_$_prompt_colors[host]$_C"%M${SSH_CLIENT:+ ← $(host ${SSH_CLIENT/ */} | awk '/not found/ { print "'${SSH_CLIENT/ */}'" ; exit } { gsub(/\.$/, "", $NF); gsub(/.'$DOMAIN'$/, "", $NF); print $NF }')} "$CURDIR${VCSBRANCH:+ $VCSBRANCH} + __debug "-----------------> extra..." PS1_+=$(__ps1_extrainfo) __debug "-----------------> PS1..." diff --git a/net:foret/Functions.zsh b/net:foret/Functions.zsh new file mode 100644 index 0000000..0a77351 --- /dev/null +++ b/net:foret/Functions.zsh @@ -0,0 +1,34 @@ + +_cn () { + local _CN=/usr/local/Cavium_Networks/ + local SDK MODEL GCC + case $1 in + ([Oo]+*) MODEL=OCTEON_CN58XX + SDK=${2:-OCTEON-SDK-1.7.2} + case $1 in + (*-) GCC=tools ;; + (*) GCC=tools-gcc-4.7.2 ;; + esac + TARGET=OCTEONPLUS_64-CAVIUMSE-SMP-PERF-EXTFLOW ;; + ([Oo]2*) case $1 in + (O*) MODEL=OCTEON_CN68XX ;; + (o*) MODEL=OCTEON_CN66XX ;; + esac + SDK=${2:-cnUSERS-SDK-2.3} + case $1 in + (*-) GCC=tools ;; + (*) GCC=tools-gcc-4.7.2 ;; + esac + TARGET=OCTEON2_64-CAVIUMSE-SMP-PERF-EXTFLOW ;; + (*) TARGET=x86_64-LSB-SMP-PERF-EXTFLOW + unset OCTEON_ROOT ;; + esac + PATH=${(j/:/)$(echo ${${(s/:/)PATH}##/usr/local/Cavium_Networks/*})} + if [ -n "$SDK" ] + then + pushd $_CN/$SDK > /dev/null 2>&1 + source ./env-setup $MODEL --runtime-model --tools=$GCC + popd > /dev/null 2>&1 + fi +} + @@ -6,12 +6,12 @@ # # If you want to add a file, name it specifically in the form # -# $ZDOTDIR/??_*.zsh +# $ZDOTDIR/??_*.zsh # # Where "??" should be a two-digit number. # With that, file ``10_Toto.zsh'' would be parsed before # file ``20_Tutu.zsh'', allowing you ordering your scripts. -# +# # If you want to make user, host or network specific configurations, # add your specific scripts to the folders # - "sys:$(uname -s)" for OS-specific conf, @@ -38,6 +38,7 @@ HOST=$HOST:r HOST=${HOST:-$(hostname -s)} DOMAIN=$(hostname -a 2>&-| sed 's/^[^\.]*\.\?//') DOMAIN=${DOMAIN:-$(hostname -d 2>&-)} +DOMAIN=${DOMAIN:-$(hostname -y 2>&-)} [ "$DOMAIN" = "" -o "$DOMAIN" = "localdomain" -o "$DOMAIN" = "(none)" ] && DOMAIN=$(grep "^search " /etc/resolv.conf | cut -d' ' -f2) ## Agent de clefs SSH/GPG |