In case you don't already know, the version 16.04 of Ubuntu LTS OS brought along a couple of new apps, with GNOME Calendar being one of them.

Start Gnome Calendar

You can launch the app from the command line:

gnome-calendar

as well as through Unity Dash:

calendar-dash

But you can't access it from the system tray. Or can we? Well, there's no official way of doing this, but a member of the awesome Ubuntu community has come up with an unofficial solution to this problem.

Jacob Vlijm has created a Python script (in response to this question on AskUbuntu forums) that creates a calendar icon in the system tray, allowing you to launch the gnome-calendar app.

Start Gnome Calendar from System Tray

Here's what you need to do:

Create a Python file (say calendar.py), and copy the following script in it:

import signal
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('AppIndicator3', '0.1')
from gi.repository import Gtk, AppIndicator3
import subprocess

class Indicator():
    def __init__(self):
        self.app = 'test123'
        iconpath = "org.gnome.Calendar"
        self.indicator = AppIndicator3.Indicator.new(
            self.app, iconpath,
            AppIndicator3.IndicatorCategory.OTHER)
        self.indicator.set_status(AppIndicator3.IndicatorStatus.ACTIVE)       
        self.indicator.set_menu(self.create_menu())

    def create_menu(self):
        menu = Gtk.Menu()
        open_cal = Gtk.MenuItem('Show Calendar')
        open_cal.connect('activate', self.run_cal)
        menu.append(open_cal)
        # separator
        menu_sep = Gtk.SeparatorMenuItem()
        menu.append(menu_sep)
        # quit
        item_quit = Gtk.MenuItem('Quit')
        item_quit.connect('activate', self.stop)
        menu.append(item_quit)
        menu.show_all()
        return menu

    def run_cal(self, source):
        subprocess.Popen("gnome-calendar")

    def stop(self, source):
        Gtk.main_quit()

Indicator()
signal.signal(signal.SIGINT, signal.SIG_DFL)
Gtk.main()

Now, run the script using the following command:

python3 /path/to/calendar.py

If 'python3' isn't there on your system, you can install it using the following command:

sudo apt install python3-gi

As the script gets executed, you'll notice a new calendar icon in your system tray. Click that icon, and then click the 'Show Calendar' option to launch the gnome-calendar application:

calendar-icon-systray

calendar-systray-launch

How to access Ubuntu 16.04 gnome-calendar app from system tray

Leave a Reply

Your email address will not be published. Required fields are marked *

*

Ad #native_company# — #native_desc# #native_cta#