Closed SubSonicSoftware closed 5 months ago
#!/usr/bin/env python3
import os
import gi
gi.require_version('Gtk', '3.0')
gi.require_version('AppIndicator3', '0.1')
from gi.repository import Gtk as gtk, AppIndicator3 as appindicator
def main():
indicator = appindicator.Indicator.new("timeshifttray", "timeshift", appindicator.IndicatorCategory.APPLICATION_STATUS)
indicator.set_status(appindicator.IndicatorStatus.ACTIVE)
indicator.set_menu(menu())
gtk.main()
def menu():
menu = gtk.Menu()
command_one = gtk.MenuItem(label='Open Main Window')
command_one.connect('activate', open_window)
menu.append(command_one)
exit_tray = gtk.MenuItem(label='Exit Tray')
exit_tray.connect('activate', quit_app)
menu.append(exit_tray)
menu.show_all()
return menu
def open_window(_):
os.system("sudo timeshift-gtk")
def quit_app(_):
gtk.main_quit()
if __name__ == "__main__":
main()
I'm closing this for now since this has not much to do with the development of community-indicators.. @SubSonicSoftware did @nater1983 solve your problem?
I used to use this script to display icons in the system tray, trying to get it working again:
I've installed the following dependencies: indicator-application ayatana-indicator-application gir1.2-appindicator3-0.1 python-is-python3
The startup command runs without any output:
exec /usr/lib/x86_64-linux-gnu/indicator-application/indicator-application-service
And the python script returns errors I would usually ignore: