Gnome Shell's built into the top panel clock allows you to have a quick look at the current  and future events and tasks. All you need is to click the clock and it will open a panel showing the current and next month calendar with the list of currents events and tasks on the right side.

Unfortunately, this feature is only able to sync with the Evolution calendar. Evolution is a Gnome project's email and calendar application, which is similar to Outlook. While it is a fully functional email client, there are many of us who prefer to use other clients, for example, Thunderbird, to handle all their emails, events and tasks. Thunderbird is developed and supported by Mozilla Foundation, which makes it a powerful tool, and, similar to Firefox, it supports lots of different extensions.

This short article shows how to synchronize the events and tasks shown in the Gnome-Shell panel with Thunderbird's calendar, so that you can still use the email and calendar application of your choice and have all the convenience of keeping track of your schedule through the Gnome Shell panel.

Make sure Evolution is installed

The way we are going to synchronize our calendar with Gnome Shell is by using Evolution in the background. In some sense we have to do this, because Gnome Shell's calendar won't work with anything else. However, the way we do this will not require running Evolution explicitly, and some of its components are installed and run on in Gnome-Shell anyway.

Assuming that you already have Thunderbird installed, we need to make sure that some Evolution components are installed as well. Moreover, we will remove all unnecessary components after we are done, so that they won't waste the space on your disk.

There is a great chance that you already have everything needed preinstalled, but to make sure, in Ubuntu run the following:

sudo apt-get install evolution python-evolution

or, depending on the version of Ubuntu, for latest versions, (thanks to a comment below!)

sudo apt-get install evolution evolution-data-server

The second package would actually be installed due to dependencies even if we do not put it in explicitly, but we need to mark it as manually installed, so that it stays when we remove Evolution. In Fedora you need to run:

sudo yum install evolution evolution-data-server

Create a calendar in Thunderbird+Lightning

This method shows you how to synchronize the Gnome Shell top panel Calendar with a local Thunderbird (Lightning) calendar that is kept on your disk. If you use an online storage for your calendar (to sync with other computers/devices), you may want to skip the step, and adjust the procedure according to where you store the calendar.

In Thunderbird in order to work with the calendar as well as events and tasks, you need an extension called Lightning. It is available in repositories of most current Linux distributions, so just make sure it is installed as well, and you can see it in Thunderbird.

In Thunderbird

  •     create a new calendar (File>New>Calendar...),
  •     choose On the Network (important!),
  •     select the calendar type (iCalendar in our case, but it could be CalDav etc. depending on your situation and needs),
  •     provide its location (for the local storage, pick some location in your home folder that you sure won't delete in the future, e.g. file:///home/user/Documents/Calendar/my.ics),
  •     provide its Name and Color, and unclick Show Reminders

and then you are done. Now you should see the new calendar in the left panel of Thunderbird.

Right-click it and select Properties. Now you should see all the information you entered, and make sure that all three check boxes (Read Only, Show Reminders and Offline Support) are unclicked.

Open Evolution and Create Fake Identity

When you open Evolution for the first time, it forces you to create a local email account, even if the only purpose for you to run it is to create a calendar, and there is nothing you can do about this. So we are going to just create a fake email account that won't interfere with our workflow.

So, when you open Evolution for the first time, you are greeted with a Welcome wizard. Continue up to the point where it asks about your identity. At this point put in your name and any email address, something like yourname@localhost. Continue, and choose None as the Receiving Email Server Type, and Sendmail as the Sending Email Server Type. You may also want to unclick Send mail also when in offline mode. Continue to the end and click Apply.

Create a Calendar in Evolution pointing to the one in Thunderbird

Create a new calendar in Evolution (File>New>Calendar). In the open dialog choose On This Computer, or the same type you chose in Thunderbird. Then name it, pick a color and click Mark as default calendar.

For the local calendar (as described in this post), click Use an existing iCalendar (ics) file, and provide its location (same as in Thunderbird). You may want to make sure that Allow Evolution to update the file is unchecked, if you want Evolution to use it as read-only (something that we need to just show the events in the Gnome Shell panel, unless you have another program that can modify the calendar for you via Evolution).

For another type of calendar fill in all the necessary information pointing at the same location you used in Thunderbird.

Once done, click on the button Calendar on the left in Evolution, and you should see a list of calendars (defaults and just created). Right-click on the newly created one, and select Show Only This Calendar (if there is no such option, uncheck all other calendars manually).

NOTE: depending on the version of Evolution you may see different options for your calendar (either while creating it or later by right-clicking the calendar and choosing Properties). These may be such as Update whenever the file is changed, Force read only etc. If you see those, choose them accordingly, for example, with the two options above you would probably want to choose them both.

Test the Calendar

Before we close Evolution and remove all unnecessary components, we want to check if it works. Go back to Thunderbird and create an event and a task in it (for today, tomorrow and later this week). You should immediately see all the changes in the panel that appears once you click on the clock in Gnome Shell! Try to change something like events and tasks time or day, and you should see all the changed reflected in the top panel calendar immediately. Finally, remove unnecessary tasks. They should disappear on the top as well.

Remove Evolution

Unfortunately, with Gnome Shell you cannot completely remove Evolution even if you do not use it as the primary email/calendar application. But we still can do something that will keep all the desired functionality intact, but will clean up some space on the disk.

First, quit Evolution, as we do not need it anymore. In Ubuntu run the following:

sudo apt-get remove evolution && sudo apt-get autoremove

(Do not purge evolution, as this may remove some of the settings we just set up!) In Fedora try to run:

sudo yum autoremove evolution

and if this fails (you have an older version of yum) then you may use remove instead of autoremove, but this will leave some unneeded dependent packages installed. I plan to post later at some time on how to deal with remaining packages when removing programs with yum. And one method is to use autoremove instead of remove, provided it is supported by your system. (This is now posted here: read.)

In any case, make sure that when you remove Evolution, it does not require removing any other packages that are essential either for your desktop, or for your work!

Make Thunderbird Default Calendar Client

One last thing I wanted to mention, is how to make Thunderbird the default calendar client so that it will be called from within Gnome Shell when needed. In Ubuntu I used to run something like this:

gsettings set org.gnome.desktop.default-applications.office.calendar exec thunderbird

At some point that was almost the only way to make the setting consistent through out the system. But given the rapid evolution of the Gnome desktop, simple setting of Thunderbird as default through System Settings GUI might be sufficient.

Unfortunately, as of now, Thunderbird is not offered as a possible candidate to be the Calendar application of choice in System Settings. Even if Lightning is installed. This is due to the fact, that Thunderbird simply does not list itself as the one. So, let's go ahead and force it using command line!

First, let's list all and default registered calendar applications:

gvfs-mime --query text/calendar

This will probably list Evolution or even gedit as default. Now, let's change to what we want:

gvfs-mime --set text/calendar mozilla-thunderbird.desktop

If it gives you an error, something like mozilla-thunderbird.desktop not found, this is probably because in your system the Thunderbird's .desktop file has a different name. Try just thunderbird.desktop instead, or find it in /usr/share/applications.

If you run the first command now again, you should see the change. Moreover, go ahead and open System Settings GUI now, and you should see Thunderbird as the default calendar program, though it was not even listed there before.

Another approach to force Thunderbird to be listed as a possible calendar program in GUI is to add the corresponding MIME type to its .desktop file. Open its .desktop file:

sudo gedit /usr/share/applications/mozilla-thunderbird.desktop

and add the following to its MIME type:

text/calendar;text/x-vcard;

Once again, if mozilla-thunderbird.desktop did not work for you with the previous command, try thunderbird.desktop, or find the correct name in /usr/share/applications. Then close the editor, and update the database:

sudo update-desktop-database -q

This should mark Thunderbird as a possible calendar application, so that you will be able to set it using GUI.