Dec-02-2019, 08:37 PM
I do not program in python, therefore the question. With some help from another post I was able to put this tray menu together, works ok.
How can I set icons to the sub-menu items (appstore, control center, etc)?
Thanks
How can I set icons to the sub-menu items (appstore, control center, etc)?
Thanks
#!/usr/bin/python import os from gi.repository import Gtk as gtk, AppIndicator3 as appindicator def main(): indicator = appindicator.Indicator.new("customtray", "/home/unix/Bin/share/preferences/preferences.03.png", appindicator.IndicatorCategory.APPLICATION_STATUS) indicator.set_status(appindicator.IndicatorStatus.ACTIVE) indicator.set_menu(menu()) gtk.main() def menu(): menu = gtk.Menu() appstore = gtk.MenuItem('AppStore') appstore.connect('activate', appStore) menu.append(appstore) controlcenter = gtk.MenuItem('Control Center') controlcenter.connect('activate', CtrlCenter) menu.append(controlcenter) Separator = gtk.SeparatorMenuItem() menu.append(Separator) exittray = gtk.MenuItem('Quit') exittray.connect('activate', quit) menu.append(exittray) menu.show_all() return menu def appStore(_): os.system("deepin-appstore %U") def CtrlCenter(_): os.system("dbus-send --print-reply --dest=com.deepin.dde.ControlCenter /com/deepin/dde/ControlCenter com.deepin.dde.ControlCenter.Show") def quit(_): gtk.main_quit() if __name__ == "__main__": main()