X-Git-Url: https://arthur.barton.de/gitweb/?p=ax-zsh.git;a=blobdiff_plain;f=plugins%2Fremind%2Fremind.ax-io;fp=plugins%2Fremind%2Fremind.ax-io;h=05ee67628273a04fab7891347491d98a0c199c1f;hp=0000000000000000000000000000000000000000;hb=a29eeef664bd3fccfadba903f5178067537d6f1b;hpb=66062dd9a5375d6e51eaf3ec54b416a079654913 diff --git a/plugins/remind/remind.ax-io b/plugins/remind/remind.ax-io new file mode 100644 index 0000000..05ee676 --- /dev/null +++ b/plugins/remind/remind.ax-io @@ -0,0 +1,27 @@ +# AX-ZSH: Alex' Modular ZSH Configuration +# remind.zshrc: Show reminders of remind(1). + +# Make sure that "remind(1)" is installed. +(( $+commands[remind] )) || return 1 + +# Don't run this plugin on "check-plugins"! +[[ -z "$AXZSH_PLUGIN_CHECK" ]] || return 0 + +# Some handy alias. +alias remindcal='remind -ccu+3 -m -w$COLUMNS,4,0 $HOME/.remind' + +# Don't show reminders when ~/.hushlogin exists ... +[[ -r ~/.hushlogin ]] && return 0 + +# Is there a file with reminders? +[[ -r ~/.remind ]] || return 0 + +# Check if reminders have been shown during last 60 minutes, and if so, +# don't show them now but return. +[[ -z `find ~/.last_reminder -mmin -60 2>/dev/null` ]] || return 0 + +# Show reminders now. +remind -h -g -t5 ~/.remind && echo + +# Wtite "stamp" file. +[[ -w ~/ ]] && touch ~/.last_reminder