diff --git a/zsh/zsh.d/50-functions.zsh b/zsh/zsh.d/50-functions.zsh index f65c76d..3971924 100644 --- a/zsh/zsh.d/50-functions.zsh +++ b/zsh/zsh.d/50-functions.zsh @@ -15,5 +15,9 @@ autoload -U dust # bak - remove backup files autoload -U bak +# +# fancyTerm - returns true if we are on xterm/rxvt/screen, elsewhere false +autoload -U fancyTerm + # vim: set ts=4 sw=4 tw=0 ft=zsh : diff --git a/zsh/zsh.d/prompts/prompt_minimal_setup b/zsh/zsh.d/prompts/prompt_minimal_setup index 07e505f..ec99b73 100644 --- a/zsh/zsh.d/prompts/prompt_minimal_setup +++ b/zsh/zsh.d/prompts/prompt_minimal_setup @@ -1,6 +1,6 @@ function prompt_minimal_setup { # Setup PROMPT -if [ ${TERM[0,5]} = "xterm" ] || [ ${TERM} = "rxvt" ]; then +if `fancyTerm`; then # We are on xterminal W="%n@%m:%." I="%m:%." diff --git a/zsh/zsh.d/prompts/prompt_nice_setup b/zsh/zsh.d/prompts/prompt_nice_setup index ddf1cce..ef5cf59 100644 --- a/zsh/zsh.d/prompts/prompt_nice_setup +++ b/zsh/zsh.d/prompts/prompt_nice_setup @@ -1,6 +1,5 @@ function prompt_nice_setup { - -if [ ${TERM[0,5]} = "xterm" ] || [ ${TERM} = "rxvt" ]; then +if `fancyTerm`; then W="::: %n at %m in %. :::" I="%m::%." L="%B%K{blue}%F{white}@%m::%2~ %f%k diff --git a/zsh/zsh.d/prompts/prompt_plain_setup b/zsh/zsh.d/prompts/prompt_plain_setup index 8f241b6..eca0b3f 100644 --- a/zsh/zsh.d/prompts/prompt_plain_setup +++ b/zsh/zsh.d/prompts/prompt_plain_setup @@ -1,6 +1,6 @@ function prompt_plain_setup { # Setup PROMPT -if [ ${TERM[0,5]} = "xterm" ] || [ ${TERM} = "rxvt" ]; then +if `fancyTerm`; then # We are on xterminal W="%n@%m:%." I="%m:%." diff --git a/zsh/zsh.d/prompts/prompt_server_setup b/zsh/zsh.d/prompts/prompt_server_setup index ed38921..d27a97c 100644 --- a/zsh/zsh.d/prompts/prompt_server_setup +++ b/zsh/zsh.d/prompts/prompt_server_setup @@ -1,6 +1,6 @@ function prompt_server_setup { # Setup PROMPT -if [ ${TERM[0,5]} = "xterm" ] || [ ${TERM} = "rxvt" ]; then +if `fancyTerm`; then # We are on xterminal W="%n@%m:%." I="%m:%." diff --git a/zsh/zshrc b/zsh/zshrc index 48e0d86..10298e1 100644 --- a/zsh/zshrc +++ b/zsh/zshrc @@ -27,7 +27,9 @@ function loadRC { fi # Add local customization file, svn ignored - [ -f $1/99-local.zsh ] || echo "# Local customizations" > $1/99-local.zsh + if [ $EUID -eq 0 ]; then + [ -f $1/99-local.zsh ] || echo "# Local customizations" > $1/99-local.zsh + fi # Process all .zsh files for zshFile in $1/[0-9]*.zsh; do