]> arthur.barton.de Git - ax-zsh.git/commitdiff
Add "remind" plugin
authorAlexander Barton <alex@barton.de>
Sun, 12 Mar 2017 19:49:39 +0000 (20:49 +0100)
committerAlexander Barton <alex@barton.de>
Sun, 12 Mar 2017 19:49:39 +0000 (20:49 +0100)
Show reminders using the remind(1) tool on shell startup, but not more
often than once every hour.

plugins/remind/README.md [new file with mode: 0644]
plugins/remind/remind.zshrc [new file with mode: 0644]

diff --git a/plugins/remind/README.md b/plugins/remind/README.md
new file mode 100644 (file)
index 0000000..9b8ef57
--- /dev/null
@@ -0,0 +1,8 @@
+## remind
+
+Show reminders using the remind(1) tool on shell startup, but not more often
+than once every hour.
+
+### Command Aliases
+
+- `remindcal`: show a TUI calender for the upcoming weeks.
diff --git a/plugins/remind/remind.zshrc b/plugins/remind/remind.zshrc
new file mode 100644 (file)
index 0000000..9f27534
--- /dev/null
@@ -0,0 +1,18 @@
+# AX-ZSH: Alex' Modular ZSH Configuration
+# remind.zshrc: Show reminders of remind(1).
+
+# Make sure that "remind(1)" is installed.
+(( $+commands[remind] )) || return 1
+
+# Some handy alias.
+alias remindcal='remind -ccu+3 -m -w$COLUMNS,4,0 $HOME/.remind'
+
+# 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