From a0a46ceee960c7ea17a97af6a8f49e376d406dca Mon Sep 17 00:00:00 2001 From: Hugues Hiegel Date: Fri, 20 Jan 2012 10:24:07 +0100 Subject: [Funcs] when has now preferences for setting calendar file --- 01_Functions.zsh | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to '01_Functions.zsh') diff --git a/01_Functions.zsh b/01_Functions.zsh index b402cb8..d421602 100644 --- a/01_Functions.zsh +++ b/01_Functions.zsh @@ -405,14 +405,13 @@ set_prompt_colors () guilt_colors[unapplied]=$color[black] } -birthdays() +when() { - WHEN_FILE=~/.when/birthdays TODAY_FILE=~/.when/.today - if cmd_exists when && [ -e $WHEN_FILE ] + if cmd_exists when then - when --calendar=$WHEN_FILE $@ | tail -n+3 | \ + $(which -p when) $@ | tail -n+3 | \ sed 's/^\(aujourd.hui *[0-9][0-9][0-9][0-9] [A-Z][a-z]\+ [0-9][0-9][ ]*\)\(.*\)/'$c_'1;33'$_c'\1\2'$c_'0'$_c'/; s/^\(demain *[0-9][0-9][0-9][0-9] [A-Z][a-z]\+ [0-9][0-9][ ]*\)\(.*\)/'$c_'1'$_c'\1\2'$c_'0'$_c'/; s/^\(hier *[0-9][0-9][0-9][0-9] [A-Z][a-z]\+ [0-9][0-9][ ]*\)\(.*\)/'$c_'3'$_c'\1\2'$c_'0'$_c'/' \ -- cgit v1.2.3