pystray
Provides systray integration
What it is and what it does
Pystray is a cross-platform library for creating system tray icons with popup menus. It abstracts away platform differences by selecting the appropriate backend (native Windows APIs, Cocoa on macOS, GTK+/AppIndicator/Xlib on Linux) and presenting a unified Python API. You create an Icon object, optionally define a menu with callbacks, and call run() to display it in the system tray.
The package handles the full lifecycle of tray interaction—icon display, menu rendering, notifications, and event dispatch—while managing platform-specific quirks. It supports nested menus, checkboxes, radio buttons, disabled items, and can run in detached mode to integrate with other event loops.
Use it for:
- Build a background application that lives in the system tray with a menu for quick access to settings or actions
- Add tray icon notifications to a long-running service or daemon on Windows, macOS, or Linux
- Create a cross-platform GUI tool that minimizes to tray instead of closing, using a single codebase
- Integrate tray icon support into an existing application that uses GTK+ or another event loop via detached mode
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Pystray creates a system tray icon with an optional popup menu that works across Windows, macOS, and Linux using platform-specific backends.
Yes, if you need cross-platform tray icon support and can accept that the project is in maintenance mode. The library is stable and widely used, has no known vulnerabilities, and low install friction. The main trade-off is the aging maintenance status—no active feature development, and you may need to verify compatibility with Python versions newer than those listed in classifiers.
Install
pystray on PyPI
pip
pip install pystrayuv
uv add pystraypoetry
poetry add pystrayInstalling pystray
Before you install
Install friction is low; the package is a pure-Python wheel. Maintenance is aging—the last release was 2023-09-17, though the repository remains active with recent commits and is not archived.
License in practice
Licensed under LGPLv3 (copyleft). Any derivative work or distribution must preserve the license and make source available; static linking or closed-source wrapping is not permitted.
Quickstart
pip install pystray
import pystray
icon = pystray.Icon('test')
icon.run()
Requires a display server (X11, Wayland, Windows, or macOS); will not run headless. Platform-specific dependencies: pyobjc-framework-Quartz on macOS, python-xlib on Linux, and GTK+ or AppIndicator libraries on some Linux distributions.
Verify before relying
- Whether the package works reliably with modern Python versions (3.10+) given classifiers only list up to 3.4
- Current state of GTK+ and AppIndicator backend stability on modern Linux distributions
- Whether notifications work consistently across all supported platforms
Package facts
| License | LGPLv3 (copyleft) |
| Python support | not specified |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | 4 — Pillow, six, pyobjc-framework-Quartz, python-xlib |
| Maintenance | aging — 1,062 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 1,100,563/month — #4,369 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pystray-0.19.5-py2.py3-none-any.whl
Keywords: system tray icon, systray icon
Tags
More Utilities packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
charset-normalizerDetects and normalizes text encoding from…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
PygmentsPygments is a syntax highlighter that colorizes…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
infi.systrayImplements a Windows system tray icon with a…
permissive · top 15,000 on PyPI
pyshortcutsCreates desktop and Start Menu shortcuts for…
permissive · top 15,000 on PyPI
notify_pySends cross-platform desktop notifications from…
permissive · top 15,000 on PyPI
desktop-notifierSends cross-platform desktop notifications from…
permissive · top 15,000 on PyPI
notify2notify2 creates and displays desktop…
permissive · top 15,000 on PyPI
app-modelProvides a declarative schema for organizing…
permissive · top 15,000 on PyPI
streamlit-option-menuA Streamlit component that renders a static…
unclear · top 15,000 on PyPI
darkdetectDetects whether the operating system is in Dark…
permissive · top 5,000 on PyPI
PyMsgBoxPyMsgBox provides JavaScript-like message box…
copyleft · top 5,000 on PyPI
colcon-notificationAdds desktop notifications to colcon build…
permissive · top 15,000 on PyPI