Linux PyQt tray application to control OctoPrint instances
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

main.py 697B

1234567891011121314151617181920212223242526272829303132
  1. #!/usr/bin/env python3
  2. # OctoTray Linux Qt System Tray OctoPrint client
  3. #
  4. # main.py
  5. #
  6. # Entry point for OctoTray application.
  7. # Depends on 'python-pyqt5'.
  8. import sys
  9. import signal
  10. from PyQt5.QtWidgets import QSystemTrayIcon, QApplication
  11. from OctoTray import OctoTray
  12. app = QApplication(sys.argv)
  13. app.setQuitOnLastWindowClosed(False)
  14. signal.signal(signal.SIGINT, signal.SIG_DFL)
  15. inSysTray = QSystemTrayIcon.isSystemTrayAvailable()
  16. if ("windowed" in sys.argv) or ("--windowed" in sys.argv) or ("-w" in sys.argv):
  17. inSysTray = False
  18. tray = OctoTray(app, inSysTray)
  19. rc = app.exec_()
  20. while rc == 42:
  21. tray.closeAll()
  22. tray = OctoTray(app, inSysTray)
  23. rc = app.exec_()
  24. sys.exit(rc)