Empty Indicator for Ubuntu

Want to create an indicator for Ubuntu but don’t know were to start? Well here is an empty indicator that’s ready to go; this isn’t a tutorial – simply an empty file that can be downloaded and modified as necessary.

You can either copy and paste the code below using your favourite text editor and save the file with a .py extension or you can downloaded the code at the bottom of the page. The emptyindicator only has one feature, an exit button.

*Important* Make sure to modify lines 11 and 14!


#!/usr/bin/env python

# Import
import gtk
import appindicator

# Variables
FREQUENCY           = 5

# Image Directory
IMAGEDIRECTORY      = "/path/to/image/directory"

# Images
ICON_SMALL          = IMAGEDIRECTORY + "image.png"

# Create Menu Object
MENU               = gtk.Menu()

# Constructor
class emptyindicator:

    def __init__(self):
        self.indicator = appindicator.Indicator("emptyindicator",
        ICON_SMALL,
        appindicator.CATEGORY_APPLICATION_STATUS)

        self.indicator.set_status(appindicator.STATUS_ACTIVE)

        # Set up menu
        self.menu_setup()
        self.indicator.set_menu(MENU)

        # Set up Menu
        def menu_setup(self):

        # Quit
        MENUITEM = gtk.ImageMenuItem(gtk.STOCK_QUIT, "Refresh Menu")
        MENUITEM.set_always_show_image(True)
        MENUITEM.show()
        MENUITEM.connect("activate", self.quit)
        MENU.append(MENUITEM)

    def main(self):
        gtk.main()

    def quit(self, w):
        gtk.main_quit()

    def newTickets(self):
        return 0

if __name__ == "__main__":
    indicator = emptyindicator()
    indicator.main()

Download the code – emptyindicator.tar.gz!

Leave a Reply

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