summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugues Hiegel <hugues@hiegel.fr>2012-01-20 10:24:07 +0100
committerHugues Hiegel <hugues@hiegel.fr>2012-01-20 11:05:32 +0100
commita0a46ceee960c7ea17a97af6a8f49e376d406dca (patch)
tree6ed2b0ef24929789e88f30683e818cb0308990f3
parente7a6bf828ddda4abdc1a973fb04df70ec29d5757 (diff)
[Funcs] when has now preferences for setting calendar file
-rw-r--r--.zlogin2
-rw-r--r--01_Functions.zsh7
2 files changed, 4 insertions, 5 deletions
diff --git a/.zlogin b/.zlogin
index 54a7f1b..449706b 100644
--- a/.zlogin
+++ b/.zlogin
@@ -1,6 +1,6 @@
cmd_exists keychain && eval $(keychain --eval --inherit any-once --quick)
-birthdays
+when
true
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'/' \