"reminders": touch stamp file only when reminders were shown
authorAlexander Barton <alex@barton.de>
Tue, 26 May 2015 21:05:42 +0000 (23:05 +0200)
committerAlexander Barton <alex@barton.de>
Tue, 26 May 2015 21:05:42 +0000 (23:05 +0200)
And slightly restructure code.

plugins/reminders/reminders.plugin.zsh

index ff865f602c33ac729a6ca25dc82856a046fe34a2..26bf9631a4e339a08b8e4d53ac94819910ffc20d 100644 (file)
@@ -1,5 +1,5 @@
 # reminders.plugin.zsh
-# 2015-03-27, alex@barton.de
+# 2015-05-26, alex@barton.de
 
 # Show reminders (once every 60 minutes)
 if [ -z `find ~/.last_reminder -mmin -60 2>/dev/null` ]; then
@@ -18,13 +18,11 @@ if [ -z `find ~/.last_reminder -mmin -60 2>/dev/null` ]; then
                [ $? -eq 0 ] && echo
                unset bul bul_imp sep
                [ -w ~/ ] && touch ~/.last_reminder
-       else
+       elif [ "$(type remind 2>/dev/null)" -a -r ~/.remind ]; then
                # remind(1)
-               if [ "$(type remind 2>/dev/null)" -a -r ~/.remind ]; then
-                       remind -h -g -t5 ~/.remind | \
-                               grep -v '^Reminders for ' | grep -v '^$'
-                       [ $? -eq 0 ] && echo
-               fi
+               remind -h -g -t5 ~/.remind | \
+                       grep -v '^Reminders for ' | grep -v '^$'
+               [ $? -eq 0 ] && echo
                [ -w ~/ ] && touch ~/.last_reminder
        fi
 fi