Bit side of life

Technical notes of digital heart

Get Notified

| Comments

org-mode is definitely one of the most versatile notes & planning tools I have ever seen. It’s also number one in my daily GTD practices.

Recently, I discovered one tiny feature which makes my work with org-mode even sweeter - notifications. Suppose you have just planned a super-duper important meeting with your girlfriend. As natural born programmer, you have already created entry in you org-mode planner.

Unfortunately, org-mode by default will not warn you about upcoming event. It’s very easy to overlook it, especially when you are deep in your matrix trying to decrypt one more perl script…

But don’t despair. Notifications come to the rescue - few minutes before meeting you will get a growl/growl-like message (possibly with shocking biiing-booong sound) reminding you about your crucial appointment.

To make it working on windows, I used ToDoChiKu along with Snarl which displays fancy growl-like messages. The dark side of this solution is that ToDoChiKu is no longer compatible with Snarl 2.5. You will see no messages without a simple todochiku.el patch.

Having ToDoChiKu patched we need to register emacs app to get notifications. Go into C:\Program Files\full phat\Snarl\tools where you should find a heysnarl.exe. Next, type in console:

heysnarl.exe “register?app-sig=app/emacs&title=Emacs Org-Mode&icon=C:\Program Files\full phat\Snarl\etc\icons\emacs.png”

app/emacs is our application signature used by ToDoChiku, and icon is a path to whatever icon you want. I used this one. Once emacs is installed, you should see it on the list of registered Snarl applications.

You may also test if messages appear correctly:

heysnarl.exe “notify?app-sig=app/emacs&title=Simple test&text=dupa”

Oki, we have Snarl working, let’s go back to Emacs. To complete our ToDoChiku configuration we need following stuff:

1
2
(setq todochiku-command "C:/Program Files/full phat/Snarl/tools/heysnarl.exe")
(require 'todochiku)

and a bit of magic to ask org-mode to use ToDoChiku as notification tool:

1
2
3
4
(setq org-show-notification-handler
  '(lambda (notification)
     (todochiku-message "org-mode notification" notification
                        (todochiku-icon 'emacs))))

Note that requiring ‘todochiku should be placed after setting up the todochiku-command. Otherwise you will get a “respawn process” error while starting up your emacs next time.

Assuming todochiku is working correctly (you may verify that, eg. by evaluating in your scratch buffer something like (todochiku-message "Simple test" "dupa" nil)) we finally need to enable appointments:

1
2
3
4
5
(setq
  appt-activate 1
  appt-message-warning-time 15
  appt-display-mode-line t
  appt-display-format 'window)

With above settings appointments will be displayed in two modes: in your mode-line and in separate popup. ToDoChiku by default overrides appt-disp-window-function redirecting all messages to Snarl process, so we don’t need to do that by ourselves.

Ok, time for final test. Create an appointment in your org-mode and wait…

Appointment

Comments