Skip to content

Instantly share code, notes, and snippets.

@candidtim
Last active September 8, 2020 14:58
Show Gist options
  • Star 5 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save candidtim/c943835a9742f5021eeb to your computer and use it in GitHub Desktop.
Save candidtim/c943835a9742f5021eeb to your computer and use it in GitHub Desktop.
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()
@DEBADRIBASAK
Copy link

I am running this script, but it is not showing the icon. It is only showing this warning:
LIBDBUSMENU-GLIB-WARNING **: 20:23:27.780: About to Show called on an item wihtout submenus. We're ignoring it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment