Friday, January 5, 2007

GCalDaemon: sync both ways between iCal and Google Calendar

The good news is, I found a way to have bi-directional synchronization between Google Calendar and Apple's iCal! The bad news is, it only works for one calendar, and of course I have more than one in both places. The software to pull this off is GCALDaemon; I used version 1.0 from 2006-12-23. I've included some Terminal commands with the steps below to make it easy.

  1. download the Unix-compatible version and unzip GCALDaemon into /bin (paths are hard-coded, so it needs to be /bin so you'll need to use sudo to modify /bin, and you'll end up with /bin/GCALDaemon)
    • cd /bin
    • sudo unzip drag-and-drop gcaldaemon-linux-*.zip file on Terminal
  2. change all semi-colons in /bin/GCALDaemon/bin/ and /bin/GCALDaemon/bin/ to colons at least for version 1.0
    • cd /bin/GCALDaemon/bin
    • cp password-encoder.oops
    • tr ";" ":" < password-encoder.oops >
    • cp standalone-start.oops
    • tr ";" ":" < standalone-start.oops >
  3. put a colored label on all folders in ~/Library/Application Support/iCal/Sources
    • open ~/Library/Application\ Support/iCal/Sources
  4. launch iCal, and create a new calendar, maybe named Google
    • open -a iCal
  5. quit iCal, and see which folder doesn't have a label in ~/Library/Application Support/iCal/Sources (you can't go by timestamp since all calendars will be updated by iCal, but colored labels will show you the new folder clearly)
  6. follow the directions for file-based synchronization like Rainlendar
    • put the full path to corestorage.ics in that new, unlabeled folder (like /Users/nethope/Library/Application\ Support/iCal/Sources/C00EE8A4-C0C1-EDC5-AA52-6AEC88F8D30B.calendar/corestorage.ics with no ~ shortcut) into /bin/GCALDaemon/conf/gcal-daemon.cfg for the variable file.ical.path

I submitted a SourceForge bug report about the colons versus semi-colons error, so it might be fixed in version 1.1. In that case, the tr commands above to replace semi-colons with colons won't have anything to change in the two scripts, but shouldn't break them either. (You can always skip that step, and come back to it only if you see Java errors when you run those scripts.) According to Java documentation, "a class path may include several paths, separated by a semicolon (Windows) or colon (Unix)", so it's just a simple platform translation issue.

My backup plan, if GCALDaemon didn't work, was to try GCalSync and to have my Palm OS Treo be the intermediary to translate between Google Calendar and iCal. I don't know if that approach allows multiple calendars; if it does, then I would prefer it. I sync my Treo to my Mac with The Missing Sync specifically because I want to have multiple iCal calendars on my Mac that are also on my Treo, and I outgrew Palm Desktop a while ago (don't get me wrong, that's a good application too, but it doesn't have as many external choices to create a new event without leaving the current application).

My other backup plan was ScheduleWorld. It looks really interesting since it supports pretty much anything that stands next to a standard, and it might be a better solution. (Although I wanted to avoid needing another server, like the GooSync service.) It seems like this ought to be a simple process, an internet-connected Mac with access both to iCal and to Google Calendar, both of which talk the iCalendar standard. Who needs an intermediate server? Who needs a translator?

I guess I like GCALDaemon (for the moment) because it allows iCal and Google Calendar to talk directly. In my backup plans, I would either use Treo+GCalSync or ScheduleWorld to translate between two applications that both use RFC 2445. Why translate? Just connect 'em. Stay tuned to this channel when I put GCALDaemon into launchd (probably with Lingon).

My setup: PowerBook G4 (almost two years old) running Mac OS X 10.4.8 (current) with iCal 2.0.3 (also current), Gmail (I don't know if a plain Google account works), and Google Calendar.

No comments:

Post a Comment