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.
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.
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.
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.
Formatting is done with ormolu (available in the flake dev shell):
scripts/fmt
scripts/fmt-check