If you want to integrate your Org mode agenda into other calendars, this is an easy way to do it. There are multiple reasons why you might want to do such a thing - for example to get notifications in your favorite calendar application or to share your daily agenda with coworkers.

The following Elisp code exports your Org mode agenda files to an iCalendar file. iCalendar (or ICS) is a standard for exchanging calendaring information. If you host this file on a web server, it can be consumed by any calendar application that supports iCalendar. Here are some guides for different calendar app providers:

You could run the function org-agenda-export-to-ics as a hook whenever you change an agenda file. Since I'm editing my Org files not just with Emacs, but also with organice, I'm doing this on a regular basis in a cron job which runs this code:

#!/bin/bash
emacs -batch -l ~/.emacs.d/init.el -eval "(org-agenda-export-to-ics)" -kill

if [[ "$?" != 0 ]]; then
  notify-send -u critical "exporting org agenda failed"
fi

The hourly cron job looks like this:

0 * * * * /home/munen/bin/export-org-agenda.sh

If you liked this post, please consider supporting our Free and Open Source software work - you can sponsor us on Github or star our FLOSS repositories.