Skip to main content

bettersystray

Windows only. Thread-safe system tray icons for Windows 10 and later.

  • Every method is safe to call from any thread
  • Animated icons
  • Right-click menus that are rebuilt on every click, with check marks, disabled items and submenus
  • Callbacks run on a worker thread, so slow callbacks never freeze the icon
  • Sharp icons on high DPI screens, and the icon comes back if Explorer restarts

Install

pip install bettersystray

Usage

from PIL import Image

from bettersystray import BetterSysTray, MenuItem, MenuSeparator

tray = BetterSysTray(
    Image.open("icon.png"),
    "My app",
    lambda: [
        MenuItem(label="Hello", callback=lambda: print("Hello")),
        MenuSeparator(),
        MenuItem(label="Quit", callback=tray.stop),
    ],
    click_handler=lambda: print("Clicked"),
)
tray.start()

start() returns right away. The process stays alive until stop() is called.

Change the tray at any time, from any thread, with update(). Only the values you pass change, and values equal to the current ones are skipped:

tray.update(title="New tooltip")
tray.update(icon=image)
tray.update(icon=[frame1, frame2, frame3])  # animates at the interval given to BetterSysTray
tray.update(icon=[frame1, frame2, frame3], interval=0.05)
tray.update(interval=0.2)  # changes the speed of the current animation

An icon counts as unchanged when you pass the same image objects again. To show changes made to an image in place, pass a copy, such as image.copy().

Demo

examples/example.py is an interactive console demo of every feature:

python examples/example.py

License

MIT

Metadata

Release files for bettersystray 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for bettersystray 0.2.0
File Interpreter ABI Platform Actions
bettersystray-0.2.0-py3-none-win32.win_amd64.win_arm64.whl Python 3 none Windows ARM64, Windows x86-32, Windows x86-64 Details for bettersystray-0.2.0-py3-none-win32.win_amd64.win_arm64.whl

Release files / bettersystray-0.2.0-py3-none-win32.win_amd64.win_arm64.whl

Download URL bettersystray-0.2.0-py3-none-win32.win_amd64.win_arm64.whl
Size 14.6 kB
Tags Python 3 Windows ARM64 Windows x86-32 Windows x86-64
SHA-256 checksum
How to use checksums
a5b6f806b97b3beb6116c946b77a3895771f715a1d110726564634220a6ee81a
BLAKE2b-256 checksum
How to use checksums
e6a68b3906033bff7cbe5eba76d6a1bb8a5ff7fb1405b8355c8e2261c32ef6db
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.17 {"installer":{"name":"uv","version":"0.9.17","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":null,"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for bettersystray 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page