]> arthur.barton.de Git - ax-zsh.git/blob - plugins/remind/remind.zshrc
remind: Don't show error message when there is no "remind" file
[ax-zsh.git] / plugins / remind / remind.zshrc
1 # AX-ZSH: Alex' Modular ZSH Configuration
2 # remind.zshrc: Show reminders of remind(1).
3
4 # Make sure that "remind(1)" is installed.
5 (( $+commands[remind] )) || return 1
6
7 # Don't run this plugin on "check-plugins"!
8 [[ -z "$AXZSH_PLUGIN_CHECK" ]] || return 0
9
10 # Some handy alias.
11 alias remindcal='remind -ccu+3 -m -w$COLUMNS,4,0 $HOME/.remind'
12
13 # Don't show reminders when ~/.hushlogin exists ...
14 [[ -r ~/.hushlogin ]] && return 0
15
16 # Is there a file with reminders?
17 [[ -r ~/.remind ]] || return 0
18
19 # Check if reminders have been shown during last 60 minutes, and if so,
20 # don't show them now but return.
21 [[ -z `find ~/.last_reminder -mmin -60 2>/dev/null` ]] || return 0
22
23 # Show reminders now.
24 remind -h -g -t5 ~/.remind && echo
25
26 # Wtite "stamp" file.
27 [[ -w ~/ ]] && touch ~/.last_reminder