summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.zlogin8
-rw-r--r--.zshrc2
-rw-r--r--01_Functions.zsh9
-rw-r--r--11_Prompts.zsh6
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