Remind – a sophisticated calendar and alarm program
February 2nd, 2007 by
andreas
I’ve been using Remind for several years now, with great success. For instance, I’ve put Remind in charge of reminding me of upcoming birthdays, whether it is relatives or friends, giving me a fair chance of greeting them or buying a present in advance. The scripting language is a bit overwhelming, but instructing Remind to remind you about simple repetetive events or one-time-events is quite simple. The fun, and perhaps frustration, begins when you need to deal with moving holidays and other exceptions.
Remind by itself is a console application, but several front/back-ends have been written for Remind, making it attractive for those of us who prefer graphical user interfaces.
I run Remind from my console every time I log in, using the following technique in /etc/profile
if [ -f ~/.reminders ]; then
/usr/bin/remind
fi
To give the reader an introduction to Remind syntax, I’ve prepared a couple of simple Remind rules.
# Remind me 14 days in advance that andreasblaafladt.com expires on 2008-01-02
rem 2 Jan 2008 +14 MSG andreasblaafladt.com expires %b
# I pay the rent the 1st of every month, but I like to be reminded a week in advance
rem 1 +7 MSG Rent is due %b
# I have a meeting at a particular day at a given time.
rem 13 feb 2007 +7 AT 18:30 MSG Meeting with John Doe %b
%b is replaced with a text indicating how many days there’s left to the given date. There’s a wealth of substitution sequences, read the manpage for details.
Now that we’re over the basics, I’ll try to demonstrate some of the power of Remind while still keeping it simple.
# I report and pay taxes the 10th of every second month, or the following monday if the 10th is a saturday or sunday.
# Example output: taxes on 12/02/2007 (in 10 days' time)
rem 10 Mon, Tue, Wed, Thu, Fri +15 SATISFY [monnum(trigdate()) % 2 == 0] MSG taxes %e (%b)
# Function which returns a string with the difference (in years) between yr and the day of the trigger
FSET _yr_num(yr) ORD(YEAR(TRIGDATE()) - yr)
# Here's a rule for reminding me about a birthday (30 days ahead)
# and using the above function to calculate age dynamically every year.
# Example output: John Doe 27th bursdag in 32 days' time
REM 6 Mar +30 MSG John Doe [_yr_num(1980)] birthday %b
Using the tools shipped with Remind you can easily generate a calendar in postscript format handy for printout.
The following command gives you a single-paged pdf document with the current month and all your defined events in a nice calendar layout, suitable for distribution or printing out and keeping on the refrigerator.
$ remind -p -m -c1|rem2ps -m A4 -l -e |ps2pdf - > calendar-`date '+%G-%b'`.pdf
All in all, remind is both powerful and extemely useful for describing repetetive events with or without exceptions.
Posted in Software |
1 Comment »