Skip to content

Instantly share code, notes, and snippets.

@anaynayak
Created December 5, 2018 04:02
Show Gist options
  • Save anaynayak/419d817bb24f8b707f3cba1b5c91d384 to your computer and use it in GitHub Desktop.
Save anaynayak/419d817bb24f8b707f3cba1b5c91d384 to your computer and use it in GitHub Desktop.
import sys
from PyQt5.QtWidgets import QSystemTrayIcon, QApplication
from PyQt5.QtGui import QIcon
class BuildNotifyTest:
def __init__(self, app):
self.app = app
self.tray = QSystemTrayIcon(QIcon.fromTheme("edit-undo"), self.app)
self.tray.activated.connect(QApplication.instance().quit)
self.tray.show()
if __name__ == '__main__':
app = QApplication(sys.argv)
app.setQuitOnLastWindowClosed(False)
buildnotify = BuildNotifyTest(app)
sys.exit(buildnotify.app.exec_())
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment