diff options
author | hugues <hugues@a0e5b806-a6f9-0310-978d-cbce73f8a913> | 2007-05-17 22:38:43 +0000 |
---|---|---|
committer | Hugues Hiegel <hugues@hiegel.fr> | 2008-03-07 14:15:12 +0100 |
commit | dee8d4941f20710617465270d86eacd53e2643fb (patch) | |
tree | f0c693205ae726b0aba408460a43e5aaa3ae232f | |
parent | 39a44a361c8551a0be48a59fdbf7fa86a29a6d89 (diff) |
Correctifs apportés suite à la mise à jour sur Prunelle (Darwin)
git-svn-id: svn+ssh://hugues@maison/opt/svn/private/hugues@386 a0e5b806-a6f9-0310-978d-cbce73f8a913
-rw-r--r-- | .zlogin | 8 | ||||
-rw-r--r-- | .zshrc | 2 | ||||
-rw-r--r-- | 01_Functions.zsh | 9 | ||||
-rw-r--r-- | 11_Prompts.zsh | 6 |
4 files changed, 17 insertions, 8 deletions
@@ -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/^\(......\*.*\)/[1m\1[0m/" && \ +for i in {1..$COLUMNS} ; do echo -n "_" ; done && \ +echo "[0m" [ -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 - @@ -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 |