Skip to content

Instantly share code, notes, and snippets.

@Zackariyya
Created May 25, 2022 18:57
Show Gist options
  • Save Zackariyya/4e892bc544b8c38ea6c51e8b68832b1a to your computer and use it in GitHub Desktop.
Save Zackariyya/4e892bc544b8c38ea6c51e8b68832b1a to your computer and use it in GitHub Desktop.
#!/usr/bin/env python3
from gi.repository import AppIndicator3 as appindicator
from gi.repository import Gtk as gtk
import subprocess
if __name__ == "__main__":
indicator = appindicator.Indicator.new("My Menu", "usr/share/icons/" , appindicator.IndicatorCategory.APPLICATION_STATUS)
indicator.set_status(appindicator.IndicatorStatus.ACTIVE)
menu = gtk.Menu()
OpenChrome = gtk.MenuItem("Open Google Chrome")
OpenChrome.connect("activate", subprocess.call(["/usr/bin/google-chrome"])
exit.show()
menu.append(OpenChrome)
exit = gtk.MenuItem("Exit")
exit.connect("activate", gtk.main_quit())
exit.show()
menu.append(exit)
menu.show()
indicator.set_menu(menu)
gtk.main()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment