43 Folders

Back to Work

Merlin’s weekly podcast with Dan Benjamin. We talk about creativity, independence, and making things you love.

Join us via RSS, iTunes, or at 5by5.tv.

”What’s 43 Folders?”
43Folders.com is Merlin Mann’s website about finding the time and attention to do your best creative work.

Guest: Mike Harris looks at "Remind"

How much do I love my readers? So much.

Mike Harris very kindly sent me a suggestion about having a look at Remind, a swell little Unix program for doing CLI stuff to give yourself, well, reminders. It’s really quite powerful, that.

Despite my initially flipping the bozo bit by asking for technical support about installing Remind, Mike responded with one of the most useful emails I’ve received in a year. So good, that I asked him to move a couple things around and turn it into a full-length guest feature for 43 Folders. So he did.

Many thanks, Mike. I'm still getting my head around a lot of this, but already see many uses for this. Fellow Unix noobs: this looks like a pretty good first project, eh?


Remind

by Mike Harris

Mike Harris: Screenshot using Geek Tool to display Remind events

I’ve found a lot of the advice on 43 Folders useful (particularly the Quicksilver append trick and the mere concept of plain text being a lot more simpler of a mechanism to handle ‘to do’ lists), but had continually run into a problem — I hated having to deal with what I felt were bloated, inefficient GUI calendaring programs. I thought to myself, “Surely, with Unix having been around for a few decades by now, someone’s figured out how to have this done in plain text.” Sure enough, I was right.

Roaring Penguin is currently the caretaker of an open source project that has, in one form or another, been around since 1988, called Remind. Remind is a Unix-driven calendaring program of great flexibility and power, but, better yet, for the most part, it works with the command line and with plain text. With the deliciousness of Mac OS X, though, you can integrate it into your background processes and GUI with very little effort and splash.

Installation

In order to install Remind, you’ll need to download the package (available here) and go through the usual three Unix installation commands of ./configure, make, and sudo make install. I know that may feel intimidating to you if you're a Unix newbie, but it's actually a fairly simple process to go through: just type those three commands. Go ahead, try it! (Or, perhaps some guru out there wiser than I could use Iceberg to whip up a nice Mac OS X installer package for it.) [Merlin sez: here’s a bit of help on the holy trinity of Unix installation.]

(Update 2005-02-25 08:09:13: James Rifkin mentions his OS X installer for Remind. I haven’t tried it, but would like to hear how it works for people.)

You’ll also need to create an invisible text file in your Home directory called .reminders that will be used by the program to store all your events and reminders, one per line. To do this from Terminal.app, enter:

touch ~/.reminders

Entering in Your Calendaring Events

The one key to remember is that almost every single entry in .reminders will start with a REM and end with a %. Remind's commands are usually in plain, common-sense English -- REM is to REMind you, MSG is a MeSsaGe, and so on. For example:

REM May 5 2005 MSG Go to the White House, do the hokey-pokey, and turn myself about.%

That statement will show that particular event on May 5, 2005.

Always Useful Tip #1: Warning Yourself in Advance

%b puts either “tomorrow,” “today,” or “in x days’ time” into the text of the reminder. +## starts showing the message ## days before the actual date. In combination, they’re great for giving you countdowns to birthdays, anniversaries, movie premieres, whatever. So, putting this in your file:

REM May 7 2005 +7 MSG My dog's birthday %b.%

Would show “My dog’s birthday in 7 days’ time” on May 1, etc. It’s even smart enough to do “1 day’s time” instead of “1 days’ time”.

Always Useful Tip #2: Recurring Events

There are two very easy ways to handle recurring events. First, leaving out information will cause the task to apply more generally, i.e., leaving out the year will cause it to repeat every year, and leaving out the month will cause it to repeat every month. For example:

REM February 23 MSG This message will show every February 23rd.%
REM 23 MSG This message will show the 23rd of every month.%
REM Thursday MSG This message will show every Thursday.%

Or, if you need something to repeat every ## days, you can specify that, as well:

REM February 23 2005 *30 MSG Refill prescription from pharmacy.%

That would remind you every 30 days to refill your prescription from the pharmacy, beginning February 23, 2005.

Always Useful Tip #3: Keeping Your Text Files Neat

You can also do ‘includes’ with other text files so that you can keep events segregated, e.g., all your birthdays in one text file, all your anniversaries in another, all your financial deadlines in a third, all your favorite T.V. shows in a fourth. All you do is put:

include [path to subfile]

in the appropriate spot. I find it useful to have a “master” reminder file formatted the way I like it, with my birthdays, anniversaries, financial deadlines, and holidays separated into separate files, and an “active” file that I usually work out of for the more changing events.

Always Useful Tip #4: Just Weekdays, Please

How do you do things like a payday where it’s the 15th and the last day of the month, but not weekends?

REM 1 -1 OMIT Sat Sun MSG Payday.%
REM 16 -1 OMIT Sat Sun MSG Payday.%

Semi-Complex Tip: Date-Based Math

You can do date-based math with Remind. Going on a family vacation, and you want to remind yourself every day of how many weeks you’ve got left, and how much money you can save before then? I hadn't originally realized that Remind could do this, but David Skoll at Roaring Penguin helped me work out how Remind could work in weeks, instead of days. From there, it's a quick math problem to apply it to pounds to lose, dollars to save, and so on. These lines, for example, are in my Remind file:

fset _weeks() coerce("STRING", (trigdate()-today())/7) + plural((trigdate()-today())/7, " week")
fset _dollars() coerce("STRING", (5*(trigdate()-today())/7)) + plural(5*((trigdate()-today())/7), " more dollar")

Then, you can simply say:

REM August 5 2005 +253 MSG You have [_weeks()] until your summer vacation.%
REM August 5 2005 +253 MSG GOAL: Save [_dollars()] for summer vacation.%

Schweet, huh?

Edit 2005-03-03 21:49:32: Keep in mind, however, that Remind can only handle whole numbers in such math equations. No decimals.

Actually Viewing Your Calendar

OK … now that I’ve actually entered in all this crap, what the heck do I do now?

It begins very simply. Once you've entered in your calendaring information, all you need to do is type rem in the Terminal in order to generate today's calendar output. That's it.

Looking at Other Days

You can generate your 'datebook' for other days by simply typing rem [date] at the command line. Remind can use the same variables you see above to let you do aliases for ‘yesterday’ and ‘tomorrow’:

remind ~/.reminders `(echo 'banner %'; echo 'msg [trigger(today()+1)]') | remind -`

will give you tomorrow’s calendar.

remind ~/.reminders `(echo 'banner %'; echo 'msg [trigger(today()-1)]') | remind -`

will give you yesterday’s calendar.

Making It Work with the Mac

How do you get this to interact with the GUI, if you don’t live your life in the Terminal?

You can use GeekTool, which lets you display the output from Unix (and other items as well) on the Desktop. I use it to show a battery script, my IP information, and my Remind output on the desktop, updating every 5 minutes, as you can see in the screenshot above.

You can also install TCL/TK for Mac OS X, and then use the tkremind program that offers a GUI interface to the application. Either tkremind or TCL/TK for Mac OS X seems to be buggy, though, so it’s best to do it through a text interface, in my opinion. (I have been hoping for a while that someone will fall in love with Remind who could write a Mac OS X GUI interface for it that parallels tkremind -- since tkremind can be very useful for working out more established permutations, and is otherwise a very nice wrapper. Any takers?)

The reason I turned to Remind is that it is entirely a keyboard-driven process with no GUI. Because of that, it is incredibly quick, and the Quicksilver append trick I spoke of above allows you to “append” events to your .reminders file. I found this process much more efficient, as I did not have to wait for a GUI program to load, maneuver to the appropriate day, and then work through the application’s “add event” interface. This was also what drove me away from GUI-based "to do" programs and attracted me towards the more simple and portable to-dos-in-a-text-file concept. This makes it extremely easy to add events to a calendar by simply appending text to your .reminders file.

Other Views

Remind features command-line switches that will let you look at your reminders in different ways. You can use -c to generate your calendar for the month in raw text (or -c2 for the next two months, etc.). A slight tweak to that, -c+, will just generate it for the week. You can simply generate a raw list of events for the month using the -s switch instead (the + has the same effect here, limiting it to a week).

When you start generating calendars, you may notice a problem. When creating your calendars file, you may find that you want to subdivide it into categories, like the screenshot. You can do that by just using MSG, without a REM statement, like:

MSG Birthdays:

But, the problem with this is that “Birthdays:” will also show up on the calendar. How do you avoid this? You can append %"%"%. Thus, a subject header like:

MSG Birthdays:%"%"%

would show up on your daily display, but not your calendar. Likewise, you can generate a blank line by:

MSG  %"%"%

Note that there are two spaces between the MSG and the %"%"%. For some reason, it won’t work well otherwise.

Aside from generating the calendar in text, you can also generate it using HTML or Postscript. You do so by “piping” the output through one of two programs that come with Remind, rem2html and rem2ps. It’s probably easier to let the manual guide you through that one, or, if there’s enough of a demand, I can maybe cover it in a second article. The process is a little complex if you are new to Unix or the Terminal.

Conclusion

This sounds incredibly complex, doesn’t it? In actuality, it’s really very simple. I love the fact that I can jump into a text file and type out a quick line (or, once I work out exactly how I want to do it, through Quicksilver’s append function) without having to wait for iCal or Entourage’s interface to load, which, on my iBook G3, is slower and often lets me lose the thought before I get it open. Remind lets me do it easily, quickly, and unobtrusively.

If you’re a power user that already is champing at the bit to go further, keep in mind that Remind has a lot more power under the hood than described here. Even I’m a Remind newbie. Remind can handle timed notifications, its output can be piped through Growl, and so on. This article barely scratches the surface of what Remind can do — this baby has a lot more horsepower under the hood.

If you want to learn more about Remind than spoken here, the first thing to do is to read its man page (installed on your system when you installed Remind) from start to finish. After that, three places to get a little more information are Linux Journal’s article “Remind: The Ultimate Personal Calendar,” MacDevCenter’s “Unix Gems for Mac OS X,” and the Remind-Fans mailing list. Check them out!

Mike Harris

P.S. By the way, while I’ve got the mike, let me say that as a keyboard-oriented person, I’ve learned to love Butler creator Peter Mauer’s Witch, a window-specific application switcher, and Mailsmith, which is a fantastically powerful e-mail program with strong filtering and script support.

P.P.S. Leave me a comment here if you run into problems! I can’t promise immediate or knowledgeable responses, but I can promise to help.


Thanks a million, Mike. That was great! Grab a 12-pack and a Hipster PDA out of petty cash.

Got a good recipe for Remind that you want to share? Post to comments or trackback.

Matthew M. Boedicker's picture

Merlin you can do "tail...

Merlin you can do "tail -5" to see the last 5 lines of a file.

 
EXPLORE 43Folders THE GOOD STUFF

Popular
Today

Popular
Classics

An Oblique Strategy:
Honor thy error as a hidden intention


STAY IN THE LOOP:

Subscribe with Google Reader

Subscribe on Netvibes

Add to Technorati Favorites

Subscribe on Pageflakes

Add RSS feed

The Podcast Feed

Cranking

Merlin used to crank. He’s not cranking any more.

This is an essay about family, priorities, and Shakey’s Pizza, and it’s probably the best thing he’s written. »

Scared Shitless

Merlin’s scared. You’re scared. Everybody is scared.

This is the video of Merlin’s keynote at Webstock 2011. The one where he cried. You should watch it. »