]> arthur.barton.de Git - OhMyZshExtensions.git/blob - plugins/reminders/reminders.plugin.zsh
Remove timestamps from files, we are using Git
[OhMyZshExtensions.git] / plugins / reminders / reminders.plugin.zsh
1 # reminders.plugin.zsh
2
3 # Show reminders (once every 60 minutes)
4 if [ -z `find ~/.last_reminder -mmin -60 2>/dev/null` ]; then
5         if [ "$(type icalBuddy 2>/dev/null)" -a "$LOGNAME" != "root" ]; then
6                 # icalBuddy(1)
7                 case "$LANG" in
8                         *.UTF*) bul="•"; bul_imp="!"; sep="»"; ;;
9                         *)      bul="*"; bul_imp="!"; sep=">"; ;;
10                 esac
11                 icalBuddy -f -n -b " $bul " -ab " $bul_imp " -ps "/ $sep /" \
12                         -nc -npn -iep "title,due" -stda \
13                         tasksDueBefore:today 2>/dev/null
14                 icalBuddy -f -n -b " $bul " -ab " $bul_imp " -ps "/ $sep /" \
15                         -nc -npn -iep "title,datetime" \
16                         eventsToday+1 2>/dev/null
17                 [ $? -eq 0 ] && echo
18                 unset bul bul_imp sep
19                 [ -w ~/ ] && touch ~/.last_reminder
20         elif [ "$(type remind 2>/dev/null)" -a -r ~/.remind ]; then
21                 # remind(1)
22                 remind -h -g -t5 ~/.remind | \
23                         grep -v '^Reminders for ' | grep -v '^$'
24                 [ $? -eq 0 ] && echo
25                 [ -w ~/ ] && touch ~/.last_reminder
26         fi
27 fi