sevaht-gui
Small cross-platform GUI building blocks: a system-tray icon and a tkinter application base, shared across Sevaht desktop tools.
Documentation
Full documentation lives in docs/ and is published to GitHub Pages:
https://sevaht.github.io/sevaht-gui/.
Building the docs locally
$ uv run --group docs sphinx-build -b html docs docs/_build/html
Then open docs/_build/html/index.html. (Publishing to GitHub Pages requires
enabling Pages with the "GitHub Actions" source in the repository settings.)
Tray icon
create_tray_icon returns a single TrayIcon interface backed by the right
implementation for the platform:
- Windows — pystray.
- Linux — a
StatusNotifierItem(D-Bus) item when a usable SNI host is present (KDE/GNOME, Wayland, or fluxbox withsnixembed), falling back to a self-contained XEmbed icon on bare X11 window managers with no SNI host.
The feature model is deliberately small: a default activate action (left-click, and the default menu item where a menu is available) and a quit action. Backends that can show a menu (pystray, SNI) offer both on right-click; the menu-less XEmbed backend maps right-click straight to quit.
The icon is any IconSource — a prepared PIL.Image, a path to an image
file (both static; the common case), or a renderer Callable[[int], Image]
for apps that draw their own artwork. The tooltip and the icon can be changed
live (set_icon accepts any IconSource), so an app can reflect state either
by swapping prepared images or by re-rendering.
macOS is intentionally unsupported: a real menu-bar item there needs a single main-thread Cocoa loop shared with tk (custom PyObjC), which the threaded model used here cannot provide.
TkApp
TkApp owns a tkinter.Tk root and runs its mainloop() on the main thread,
running the tray icon's own event loop on a worker thread. Work originating off
the UI thread (e.g. tray menu callbacks) is marshalled back with
run_on_ui_thread / call_on_ui_thread. show() / hide() and the
run(start_hidden=...) flag manage window visibility (all thread-safe), and
set_window_icon accepts the same IconSource as the tray.
from sevaht_gui import TkApp, create_tray_icon
app = TkApp()
app.root.title("Example")
app.set_window_icon("icon.png") # static file; or a PIL image / renderer
icon = create_tray_icon(
"example",
"Example",
"icon.png", # any IconSource: path, PIL image, or renderer
on_activate=app.show,
on_quit=app.stop,
)
app.run(icon, start_hidden=True) # only the tray shows until activated
The library manages the tray lifecycle, window visibility, and threading; choosing and (re)drawing the artwork is left to the application.
Metadata
Release files for sevaht-gui 1.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sevaht_gui-1.0.1.tar.gz | 25.4 kB | With provenance | Details for sevaht_gui-1.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| sevaht_gui-1.0.1-py3-none-any.whl | Python 3 | none | any | Details for sevaht_gui-1.0.1-py3-none-any.whl |
Total release size: 53.2 kB
Release files / sevaht_gui-1.0.1.tar.gz
| Download URL | sevaht_gui-1.0.1.tar.gz |
|---|---|
| Size | 25.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e3c890fefc85cdf0d0c062992a089c3a1861d7b468b85c71d45a1460b406f7dc
|
|
BLAKE2b-256 checksum How to use checksums |
5447a1ed27e0b1ac1a660769869fe58196f8853b336bf7f517b3ddb9cbbf405f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logRelease files / sevaht_gui-1.0.1-py3-none-any.whl
| Download URL | sevaht_gui-1.0.1-py3-none-any.whl |
|---|---|
| Size | 27.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
efa68510372a3528bff1e884fda04d67ab222f3a289ecad2442f13dd4ff32a2b
|
|
BLAKE2b-256 checksum How to use checksums |
9d7616ca7a468bb44c083d3c7469ab10584b21d8db387a800c2a76afe7955d9d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logSecurity for sevaht-gui 1.0.1
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.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for sevaht_gui-1.0.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Oct 30, 2026.
Transparency logA 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.