gtk-sni-tray
A standalone StatusNotifierItem/AppIndicator tray
https://github.com/IvanMalison/gtk-sni-tray#readme
| LTS Haskell 23.28: | 0.1.8.1 |
| Stackage Nightly 2026-02-21: | 0.2.0.0 |
| Latest on Hackage: | 0.2.0.0 |
gtk-sni-tray-0.2.0.0@sha256:f23f8fff4332c91dbbbec12f5feb7079c94957900d881710ce81d231400c6fa0,2368Module documentation for 0.2.0.0
- StatusNotifier
- StatusNotifier.Icon
- StatusNotifier.TransparentWindow
- StatusNotifier.Tray
gtk-sni-tray
gtk-sni-tray provides a StatusNotifierHost widget written using the gtk+3 bindings for haskell provided by gi-gtk. It also provides a simple standalone executable, gtk-sni-tray-standalone, that is configured with command line arguments. This executable will run the aforementioned widget by itself in a strut window on X11, or (when available) a layer-shell surface on Wayland.
taffybar
It is generally recommeneded that you use this widget through taffybar with this module, which will allow you to combine it with other useful widgets, and will allow more flexibility in configuration.
StatusNotifierWatcher
By default, it is assumed that you are running an isolated StatusNotifierWatcher daemon. status-notifier-item provides a StatusNotifierWatcher executable that you can use for this purpose. If you get an error like
MethodError {methodErrorName = ErrorName "org.freedesktop.DBus.Error.ServiceUnknown", methodErrorSerial = Serial 7, methodErrorSender = Just (BusName "org.freedesktop.DBus"), methodErrorDestination = Just (BusName ":1.549"), methodErrorBody = [Variant "The name org.kde.StatusNotifierWatcher was not provided by any .service files"]}
when you start gtk-sni-tray-standalone it is probably because you have not started a StatusNotifierWatcher on your system. You can solve this problem by passing the --watcher flag to gtk-sni-tray-standalone, but this is not recommeneded, because many SNI processes do not monitor for new watcher processes, and so may not immediately register when this new watcher is started.
Installation
nix,
stack and
cabal can all be used to
install gtk-sni-tray.
When building with cabal, you will need the following system dependencies
available via pkg-config:
gtk+-3.0gtk-layer-shell-0(for the standalone Wayland layer-shell window)
For Nix users, this repository provides a flake dev shell. If you use direnv,
direnv allow then direnv reload should set up the environment.
If you see a Cabal error about missing pkg-config packages, scripts/cabal-run
does a quick preflight check and prints a more direct message.
Development
Formatting is done with ormolu (available in the flake dev shell):
scripts/fmt
scripts/fmt-check
Changes
Changelog for gtk-sni-tray
0.2.0.0
- Breaking: remove
buildTrayWithPriority,buildTrayWithPixbufTransform, andbuildTrayWithPriorityAndPixbufTransform. - Consolidate tray configuration into
TrayParamswith new fields:trayPriorityConfig,trayPixbufTransform, andtrayEventHooks. - Add click interception hooks via
TrayEventHooks/TrayClickHookso callers can run custom per-item behavior and choose default/override/consume.
0.1.15.0
- Fix: respect the user’s GTK icon theme when an SNI item provides IconThemePath (and handle IconThemePath values that point inside a theme directory).
- Add icon preference support (choose themed icons vs pixmaps when both are
provided) and expose it in the standalone executable with
--icon-preference. - Add optional icon recoloring in the standalone executable with
--icon-recolor. - Nix: improve flake dev shell environment so
cabal new-runcan find icon themes and gdk-pixbuf loaders. - Development: add
scripts/fmtandscripts/fmt-checkfor ormolu formatting.
0.1.14.2
- Relax executable
optparse-applicativeupper bound to< 0.20for GHC 9.12 snapshots. - Bump
dbus-menulower bound to0.1.3.2.
0.1.14.1
- Update the Nix flake lock for
status-notifier-itemto pick up a host-side deduplication fix for items that re-register under different bus names after watcher restart.
0.1.14.0
- Add tray priority matching with a new
TrayPriorityConfig. - Add
buildTrayWithPrioritywhile keepingbuildTraybehavior unchanged. - Add matcher helpers and combinators so matching can target service name/path,
menu path, item id/category/status, icon name/title, tooltip text, and
itemIsMenu.
0.1.13.2
- Bump
dbus-menulower bound to 0.1.3.1.
0.1.13.1
- Bump
dbus-menulower bound to 0.1.3 for menu-level click dispatch.
0.1.13.0
- Use extracted
dbus-menulibrary instead of inline DBusMenu implementation. - Reduce default overlay icon scale from 60% to 40%.
- Fix: clamp scaled pixbuf dimensions to >= 1 to prevent GDK assertion failure.
- Bump
dbus-menulower bound to 0.1.1.
0.1.12.0
- Add
trayCenterIconsfield toTrayParamsand--center-iconsCLI flag to center tray icons within the bar. - Anchor LibDBusMenu popup to the icon image widget instead of the EventBox for more accurate popup positioning.
0.1.11.3
- Fix menu popup positioning: use
menuPopupAtPointerwith the actual button press event (viagetCurrentEvent) so the menu appears at the click location instead of at an incorrect widget-relative position.
0.1.11.2
- Add upper bounds to all dependencies per PVP.
- Remove trailing zeros from dependency upper bounds.
0.1.11.1
- Fix menu popups on Wayland/layer-shell: use
menuPopupAtWidgetinstead ofmenuPopupAtPointerwhich fails with “no trigger event” when the GdkEvent’s window is not a valid GDK surface. - Fix menu item clicks: defer menu widget destruction via
idleAddwithPRIORITY_LOWso GTK’sactivatesignal fires before the widget is destroyed. - Fix DBus Event variant wrapping: correctly double-wrap the data parameter
to produce wire type
vinstead ofi. - Send Event DBus calls on a forked thread to avoid blocking the GTK main loop.
- Default menu backend to
HaskellDBusMenu(pure Haskell implementation). - Deferred popup for
LibDBusMenubackend to avoid assertion failures from showing the menu before the C library finishes loading the layout.
0.1.11.0
- Restore
libdbusmenu(gi-dbusmenugtk3) as the default menu backend. - Add runtime-configurable menu backend selection:
LibDBusMenu(default) orHaskellDBusMenuviatrayMenuBackendinTrayParamsand--menu-backendCLI flag.
0.1.10.2
- Fix menu popups not appearing: restore
widgetShowAllso menu items are visible, and usemenuPopupAtPointerfor reliable positioning on both X11 and Wayland. - Fix all
-Wallwarnings across library and executable.
0.1.10.1
- Fix menu popup positioning on Wayland: use
menuAttachToWidgetinstead of prematurewidgetShowAllso thatmenuPopupAtWidgetcan properly anchor the popup surface to the tray icon.
0.1.10.0
- Replace
libdbusmenuusage (gi-dbusmenugtk3) with a pure Haskell implementation of thecom.canonical.dbusmenuprotocol. - Add CSS style classes/names to tray menu widgets to make them themeable.
0.1.9.1
- Fix type error with DM.Menu and Gtk.menuPopupAtWidget by adding explicit cast to Gtk.Menu. This fixes build failures with newer GI bindings where the type hierarchy is not automatically recognized.
0.1.9.0
- Use the
gi-gtk3andgi-gdk3build dependencies, which have been renamed fromgi-gtkandgi-gdk.