1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # icalbuddy.zshrc: Show reminders using icalBuddy(1).
4 # Make sure that "icalBuddy(1)" is installed.
5 (( $+commands[icalBuddy] )) || return 1
7 # Check if reminders have been shown during last 60 minutes, and if so,
8 # don't show them now but return.
9 [[ -z `find ~/.last_reminder -mmin -60 2>/dev/null` ]] || return 0
11 tmpfile=$(mktemp ${TMPDIR:-/tmp}/icalbuddy.XXXXXX) || return 1
13 if axzsh_is_utf_terminal; then
14 bul="•"; bul_imp="!"; sep="»"
16 bul="*"; bul_imp="!"; sep=">"
20 icalBuddy -f -n -b " $bul " -ab " $bul_imp " -ps "/ $sep /" \
21 -nc -npn -iep "title,due" -stda \
22 tasksDueBefore:today 2>/dev/null >>"$tmpfile"
23 icalBuddy -f -n -b " $bul " -ab " $bul_imp " -ps "/ $sep /" \
24 -nc -npn -iep "title,datetime" \
25 eventsToday+1 2>/dev/null >>"$tmpfile"
27 if [[ -s "$tmpfile" ]]; then
28 echo; cat "$tmpfile"; echo
32 unset bul bul_imp sep tmpfile
35 [[ -w ~/ ]] && touch ~/.last_reminder