From 4a5802342207a6d9bab82971bf52dc4c6ca80934 Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Thu, 1 Oct 2009 17:24:01 +0200 Subject: [Funcs] when managment update for sudo.. --- 01_Functions.zsh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to '01_Functions.zsh') diff --git a/01_Functions.zsh b/01_Functions.zsh index 5ec09fd..f073945 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -272,20 +272,23 @@ set_prompt_colors () chpwd() { - if cmd_exists when + WHEN_FILE=~/.when/birthdays + TODAY_FILE=~/.when/.today + + if cmd_exists when && [ -e $WHEN_FILE ] then - LATEST=`stat 2>&- --printf="%z\n" .when/.today | cut -d' ' -f1` + LATEST=`stat 2>&- --printf="%z\n" $TODAY_FILE | cut -d' ' -f1` TODAY=`date "+%Y-%m-%d"` if [ "$TODAY" != "$LATEST" ] then - when w --calendar=~/.when/birthdays | tail -n+3 > ~/.when/.today + when w --calendar=$WHEN_FILE | tail -n+3 > $TODAY_FILE fi - if [ -s ~/.when/.today ] + if [ -s $TODAY_FILE ] then preprint "événements" $color[bold] ; echo - cat ~/.when/.today + cat $TODAY_FILE fi fi -- cgit v1.2.3