From ebd06ef2b1ee15155f6a782cd6663f9ccae32e5b Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Mon, 20 Apr 2009 13:53:55 +0200 Subject: [Funcs] chpwd updated to show todo & when --- 01_Functions.zsh | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) (limited to '01_Functions.zsh') 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 +} -- cgit v1.2.3