diff options
author | Hugues Hiegel <hugues@hiegel.fr> | 2009-10-01 17:24:01 +0200 |
---|---|---|
committer | Hugues Hiegel <hugues@hiegel.fr> | 2009-10-01 17:24:01 +0200 |
commit | 4a5802342207a6d9bab82971bf52dc4c6ca80934 (patch) | |
tree | 7c5797b6487e07f11bebf6b4c75231dd76316713 | |
parent | bf5da6fc3bb3cffca664db1b3a5184532cd9cfdd (diff) |
[Funcs] when managment update for sudo..
-rw-r--r-- | 01_Functions.zsh | 13 |
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 |