Syncing magic with GCALDaemon


Author: Dmitri Popov

Need to sync data between Google Calendar (Gcal) and your desktop calendaring application? GCALDaemon, a nifty Java-based utility, provides two-way synchronization between Gcal and virtually any iCalendar-compatible application. Besides the ability to sync calendaring data, GCALDaemon can act as a Gmail notifier, and can pull your Gmail contacts via LDAP.

To install GCALDaemon on Linux, download the Linux-compatible zip archive, unpack it, and move the resulting GCALDaemon folder to the /bin directory. GCALDaemon must be in the bin directory or it simply won’t work. And since GCALDaemon is written in Java, you must have the Java Runtime Environment installed on your machine.

Once GCALDaemon is installed, you have to configure it by editing the default settings in the gcal-daemon.cfg file in the /conf directory. Open the file in a text editor, and scroll to the Configuration of the File-based Synchronizer section. There are at least three things you have to modify here. First of all, you have to provide the correct Gmail address for the setting. Then you need to specify your Gmail password — but not, thankfully, in clear text. You have to encode it using the bundled password encoding script. Run the /bin/GCALDaemon/bin/ command, enter your Gmail password, and replace the default value of the setting with the resulting string.

Next, get the path to the Google Calendar that you want to use with GCALDaemon. Point your browser to the Google Calendar Web site, click on the Settings link, then on the Calendars tab. Click on the desired calendar, click the ICAL button in the Private Address section, copy the calendar link, and paste it in place of the default value of the file.private.ical.url setting — but remove the part.

To see whether everything works properly, launch GCALDaemon by running the /bin/GCALDaemon/bin/ command as root. If GCALDaemon works as it’s supposed to, you should see the following output:

  INFO  | GCALDaemon V1.0 beta 4 starting...
  INFO  | HTTP server starting on port 9090...
  INFO  | RSS/ATOM feed converter enabled.
  INFO  | HTTP server started successfully.
  INFO  | File listener disabled.
  INFO  | LDAP server disabled.
  INFO  | Gmail notifier disabled.

Now you can configure your desktop calendaring application. As an example, let’s take a look at how to set up Mozilla Lightning. Assuming the Lightning extension is already installed in your Thunderbird email client, click on the Calendars tab and press the New button to create a calendar. Select the On the Network and iCalendar (ICS) option when prompted and enter the link to your Gcal file into the Location field. Replace with http://localhost:9090/, or the address and port that the GCALDeamon runs on. Give your new calendar a name, and click Finish. You should then see all your Gcal data in the new calendar.

Using GCALDaemon, you can add and modify events in your Gcal from within the Lightning calendar. You can also configure the utility to act as a Gmail notifier. To do this, open the gcal-daemon.cfg file and scroll to the Configuration of Gmail Notifier section. Set notifier.enabled to true, replace the default values of the and settings with your Gmail account and the encoded password, save the changes, and restart GCALDaemon. From now on, GCALDaemon will notify you when you receive a Gmail message.

If you want to access your Gmail contacts from within Thunderbird, you can use GCALDaemon’s ability to pull contacts using LDAP. Again, to enable this feature, you have to edit the gcal-daemon.cfg file. In the Configuration of the Gmail Contact Converter section, enable LDAP by setting the ldap.enabled setting to true, then replace the default values of the and with your Gmail account and the encrypted password. In Thunderbird, choose File -> New -> LDAP Directory, enter “localhost” and “9080” into the Hostname and the Port number fields respectively. Restart GCALDaemon, and you can access and use your Gmail contacts from within Thunderbird.

Finally, GCALDaemon also includes a feature that allows you to subscribe to RSS feeds and view them as separate calendars. This is probably not the most practical way of managing RSS subscriptions, but if you want to give it a try, you can do it by simply creating a new calendar as previously described. The only difference is that instead of the link to your Gcal file, you enter the link to the RSS feed, replacing the domain name with localhost:9090. When you’re done, you can view the entries in the RSS feed as events in your calendar.

Dmitri Popov is a freelance writer whose articles have appeared in Russian, British, German, and Danish computer magazines.