From dee8d4941f20710617465270d86eacd53e2643fb Mon Sep 17 00:00:00 2001 From: hugues Date: Thu, 17 May 2007 22:38:43 +0000 Subject: Correctifs apportés suite à la mise à jour sur Prunelle (Darwin) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn+ssh://hugues@maison/opt/svn/private/hugues@386 a0e5b806-a6f9-0310-978d-cbce73f8a913 --- .zlogin | 8 ++++++-- .zshrc | 2 +- 01_Functions.zsh | 9 +++++++-- 11_Prompts.zsh | 6 +++--- 4 files changed, 17 insertions(+), 8 deletions(-) diff --git a/.zlogin b/.zlogin index 243e210..f7ad323 100644 --- a/.zlogin +++ b/.zlogin @@ -1,5 +1,10 @@ -[ -f $ZDOTDIR/user:`whoami`/zlogin ] && source $ZDOTDIR/user:`whoami`/zlogin +which calendar 2>&1 >/dev/null && \ +for i in {1..$COLUMNS} ; do echo -n "_" ; done && \ +echo && \ +calendar -A0 | sed "s/^\(......\*.*\)/\1/" && \ +for i in {1..$COLUMNS} ; do echo -n "_" ; done && \ +echo "" [ -f $ZDOTDIR/.keychain ] && source $ZDOTDIR/.keychain cmd_exists keychain && keychain --quiet --stop others --inherit any @@ -7,4 +12,3 @@ cmd_exists keychain && keychain --quiet --stop others --inherit any #keychain --quiet --quick 593F1F92 cmd_exists remind && remind -n - diff --git a/.zshrc b/.zshrc index 7455049..7653803 100644 --- a/.zshrc +++ b/.zshrc @@ -29,7 +29,7 @@ mkdir -p $ZDOTDIR USER=${USER:-`whoami`} UID=${UID:-`id -u`} HOST=${HOST:-$(hostname -s)} -DOMAIN=${DOMAIN:-${$(hostname -d):-$(hostname -y)}} +DOMAIN=${DOMAIN:-${$(hostname -d 2>&-):-$(hostname -y 2>&-)}} DEBUG=no diff --git a/01_Functions.zsh b/01_Functions.zsh index 9769e9a..4a0fcb7 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -49,8 +49,13 @@ cmd_exists () normal_user () { - eval `grep -v '^[$#]' /etc/login.defs | grep "^UID_" | tr -d '[:blank:]' | sed 's/^[A-Z_]\+/&=/'` - test \( $UID -ge $UID_MIN \) -a \( $UID -le $UID_MAX \) + if test -e /etc/login.defs + then + eval `grep -v '^[$#]' /etc/login.defs | grep "^UID_" | tr -d '[:blank:]' | sed 's/^[A-Z_]\+/&=/'` + test \( $UID -ge $UID_MIN \) -a \( $UID -le $UID_MAX \) + else + [ "`whoami`" != "root" ] + fi } privileged_user () diff --git a/11_Prompts.zsh b/11_Prompts.zsh index aec9f66..61a807c 100644 --- a/11_Prompts.zsh +++ b/11_Prompts.zsh @@ -24,9 +24,9 @@ WHITE=37 # - PS1_USER pour la couleur du prompt USER local # - PS1_USER_SSH pour la couleur du prompt USER distant -PS1_ROOT=$RED -PS1_USER=$BLUE -PS1_USER_SSH=$MAGENTA +PS1_ROOT=${PS1_ROOT:-RED} +PS1_USER=${PS1_USER:-BLUE} +PS1_USER_SSH=${PS1_USER_SSH:-MAGENTA} if ( [ "$SSH_TTY" != "" ] ) then -- cgit v1.2.3