diff options
author | Hugues Hiegel <hugues@hiegel.fr> | 2009-04-20 13:53:55 +0200 |
---|---|---|
committer | Hugues Hiegel <hugues@hiegel.fr> | 2009-04-20 13:53:55 +0200 |
commit | ebd06ef2b1ee15155f6a782cd6663f9ccae32e5b (patch) | |
tree | a7cbf7927175a457b04d4f180e286e849243720a /01_Functions.zsh | |
parent | 81f891e4c144e31416a505adc08ad2c0b03444d5 (diff) |
[Funcs] chpwd updated to show todo & when
Diffstat (limited to '01_Functions.zsh')
-rw-r--r-- | 01_Functions.zsh | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/01_Functions.zsh b/01_Functions.zsh index b2d8dfc..acec467 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -215,4 +215,32 @@ set_prompt_colors () git_colors[up_to_date]="$prompt_colors[up_to_date]" # git up-to-date } +chpwd() +{ + if cmd_exists when && [ -e .when/.today ] + then + LATEST=`stat 2>&- --printf="%z\n" .when/.today | cut -d' ' -f1` + TODAY=`date "+%Y-%m-%d"` + + if [ "$TODAY" != "$LATEST" ] + then + when w --calendar=~/.when/birthdays | tail -n+3 > ~/.when/.today + fi + + if [ -s ~/.when/.today ] + then + preprint "événements" $color[bold] ; echo + cat ~/.when/.today + fi + fi + + if cmd_exists todo + then + if [ $(todo | wc -l) -gt 0 ] + then + preprint "todo" $color[bold] ; echo + todo + fi + fi +} |