Skip to content
Related Articles

Related Articles

Improve Article

System tray applications using PyQt5

  • Last Updated : 22 May, 2020

In this article, we will learn how to create a System Tray application using PyQt.

System Tray(or menu bar) is an area on the taskbar in an operating system. You can find this system on the bottom right side of the desktop if you’re using windows, and top right if using macOS. The icons which are visible in this notification area are the ones that run in the foreground. Some of the famous applications which use system tray to function, and they are Windscribe(VPN application) and Adobe Creative Cloud.

 Attention geek! Strengthen your foundations with the Python Programming Foundation Course and learn the basics.  

To begin with, your interview preparations Enhance your Data Structures concepts with the Python DS Course. And to begin with your Machine Learning Journey, join the Machine Learning - Basic Level Course

Menu bar applications are also useful to minimally control the desktop application using the shortcuts provided in the menu bar icon. One can choose to not open the whole application and still work by just using the options provided on the System Tray. In this article, you will learn how to create these applications.

Below is an example of an application named Windscribe.


from PyQt5.QtGui import * 
from PyQt5.QtWidgets import * 
app = QApplication([])
# Adding an icon
icon = QIcon("icon.png")
# Adding item on the menu bar
tray = QSystemTrayIcon()
# Creating the options
menu = QMenu()
option1 = QAction("Geeks for Geeks")
option2 = QAction("GFG")
# To quit the app
quit = QAction("Quit")
# Adding options to the System Tray


As you can see there is a marker icon on my mac menu bar, and there are three options visible namely Geeks for Geeks, GFG, and quit. By clicking on the last option(quit) you will exit the application.

My Personal Notes arrow_drop_up
Recommended Articles
Page :