Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm looking to try and develop some simple indicators, for numlock/capslock and brigthness, etc. How would I go about creating indicators in python? Are there any tutorials that walk me through writing my first appindicator (like for apps in quickly)? Any easy solutions for starting like quickly templates?

share|improve this question
Especially appindicators for pyqt5 or pygi and python3 (that will also work outside unity as well). – Mateo Jun 29 '14 at 18:08
up vote 13 down vote accepted

You can find the page for writing app indicators here:

See also:

On that page you'll find links to examples in Python and the API documentation. The ubuntu-application template in Quickly should have examples on using appindicators. Good luck!

share|improve this answer
Thank you! I was hoping for a more step-by-step tutorial for my first try, but I'll make do with what is. I'll keep the question open for now in case someone knows of some other tutorials. – DoGoDo Nov 11 '12 at 21:02
You'll find a tutorial to get you started on - check out the resources section for more content too! – David Planella Nov 11 '12 at 21:50
Thanks, @DavidPlanella I watched that tutorial to get started with normal programmes, but it doesn't even mention indicators. Neither does the other link. – DoGoDo Nov 11 '12 at 21:57
What do you not understand about the example here? It is a straightforwarded, simple, working example (taken from link in answer)… – Timo Nov 11 '12 at 22:43
Similar or the same question here -… – fossfreedom Jun 24 '14 at 18:10

I think Writing indicators with Python, GIR and GTK3 ,as mentioned by @fossfreedom, covers how create indicators for Unity. (Read that 1st)

I'm using Ubuntu 14.04, Quickly 12.08.1 . This is demo for a complete working example build from a Quickly template.

  1. OP wants just indicator (not complete GUI app) so let's start with ubuntu-cli Quickly template:

    quickly create ubuntu-cli indicator-demo

    It may raise an error message for unreleased bug fix (bug#1064110) in this template:

    Creating project directory indicator-demo
    Creating bzr repository and committing
    Launching your newly created project!
    Traceback (most recent call last):
    OSError: [Errno 13] Permission denied
    ERROR: create command failed

    Fix permissions

    cd indicator-demo/
    chmod +x bin/indicator-demo


    $ quickly run
    I'm launched and my args are:
  2. There is a nice PYGI example from Ubuntu Wiki: Application Indicators. It should be easy to integrate it.

    Open for edit:

    quickly edit
    • Modify, add need modules imports:

      from gi.repository import Gtk
      from gi.repository import AppIndicator3 as appindicator
    • In the main() function, between:

      print _("I'm launched and my args are: %s") % (" ".join(args))
      logging.debug(_('end of prog'))


      ind = appindicator.Indicator.new_with_path (
                          _("Indicator demo for Quickly"),
      ind.set_status (appindicator.IndicatorStatus.ACTIVE)
      ind.set_attention_icon ("indicator-demo-icon-attention")
      # create a menu
      menu = Gtk.Menu()
      # create one item 
      menu_items = Gtk.MenuItem(_("Quit"))
      # this is where you would connect your menu item up with a function:
      menu_items.connect("activate", Gtk.main_quit )    
      # show the item
  3. Add icons to a newly created data folder:

    mkdir data

    I copied some icons from installed packages, just to make the example:

    cp /usr/share/icons/ubuntu-mono-dark/status/22/indicator-messages.svg data/indicator-demo-icon-normal.svg
    cp /usr/share/icons/ubuntu-mono-dark/status/22/indicator-messages-new.svg data/indicator-demo-icon-attention.svg
  4. Test it:

    quickly run
  5. Create package and publish it:

    quickly package
    quickly share --ppa your-ppa


  1. Well, I didn't update debian package control file, But the dependencies have been auto added to the generated DEB:

    Package: indicator-demo
    Version: 0.1
    Architecture: all
    Maintainer: UNKNOWN <UNKNOWN>
    Installed-Size: 57
    Depends: python (>= 2.7), python (<< 2.8), python:any (>= 2.7.1-0ubuntu2), gir1.2-gtk-3.0, gir1.2-appindicator3-0.1
    Section: python
    Priority: extra
    Description: UNKNOWN

    Also, the previously added icons in data folder were included in the package.

  2. I faced a similar case before, How to add a keyboard modifier state applet to Unity panel?. The answer contains an example/prototype keyboard indicator using libappindicator (But in the c programming language).

    libappindicator lacks an important feature which make easy to ports other desktops indicators. Icon can be loaded only from path. See Bug #812067 API needed: pixbuf icon setting support


Related Questions:

share|improve this answer

This link will teach you to create a basic new mail indicator in python+unity, which works with GMail. This will give you a solid grounding in the basic structure of an applet while providing a real-world (albeit simplistic) example that you can easily extend. It's go through the final script piece by piece.
This is another python program with comments in code, made using Pygtk

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.