Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Minimal set-up for an Ubuntu AppIndicator in Python
from gi.repository import Gtk as gtk
from gi.repository import AppIndicator3 as appindicator
APPINDICATOR_ID = 'myappindicator'
def main():
indicator = appindicator.Indicator.new(APPINDICATOR_ID, 'whatever', appindicator.IndicatorCategory.SYSTEM_SERVICES)
indicator.set_status(appindicator.IndicatorStatus.ACTIVE)
indicator.set_menu(gtk.Menu())
gtk.main()
if __name__ == "__main__":
main()
@wjgeorge

This comment has been minimized.

Copy link

commented Apr 11, 2017

Under ubuntu 16.04, python 2.7 I get a bunch of error messages about missing version numbers, add to the top of the module:

import gi
gi.require_version('Gtk', '3.0')
gi.require_version('AppIndicator3', '0.1')

@Patola

This comment has been minimized.

Copy link

commented Jan 8, 2018

@wjgeorge, install gir1.2-appindicator3-0.1 or equivalent package to your distribution.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.