summaryrefslogtreecommitdiff
path: root/01_Functions.zsh
diff options
context:
space:
mode:
authorHugues Hiegel <hugues@hiegel.fr>2009-10-01 17:24:01 +0200
committerHugues Hiegel <hugues@hiegel.fr>2009-10-01 17:24:01 +0200
commit4a5802342207a6d9bab82971bf52dc4c6ca80934 (patch)
tree7c5797b6487e07f11bebf6b4c75231dd76316713 /01_Functions.zsh
parentbf5da6fc3bb3cffca664db1b3a5184532cd9cfdd (diff)
[Funcs] when managment update for sudo..
Diffstat (limited to '01_Functions.zsh')
-rw-r--r--01_Functions.zsh13
1 files changed, 8 insertions, 5 deletions
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