snixembed - proxy StatusNotifierItems as XEmbedded systemtray-spec icons
INFO: recent electron versions supports XEmbed tray icons again for now.
While many status bars for simple X window managers do not (yet) support StatusNotifierItem for displaying system tray icons, some software does not fall back to the widely supported XEmbed-based tray icon protocol. snixembed acts as a proxy between the new and old. (It does this by presenting itself as a StatusNotifierHost on the session bus, and using GTK+3 to maintain corresponding XEmbed tray icons.)
This is enough for most software, such as electron and Qt based applications. Please see the known issues and issue tracker if an app doesn't work properly.
¹: so-called AttentionIcons and OverlayIcons are not supported, but I have yet to encounter software that uses this part of the spec. Qt does not support it.
snixembed to start watching for icons.
Some applications only present a tray icon if snixembed is available on start.
For autostarting, use
snixembed --fork before starting SNI applications to
avoid race conditions. This will fork once the service is running. (e.g. in an
snixembed --fork instead of
snixembed & before tray apps)
See also the included man page.
These should be packaged in most major distributions.
make to build and if desired
make install to install,
by default to
For Gentoo/Portage, powerman made an ebuild.
For Void Linux, it is packaged by projectmoon.
ayatana/libappindicator seem to think their standard is supported when they see the service, and then start talking appindicator to it. Therefore they do not fall back to XEmbed specification, and snixembed gets a load of AppIndicator jargon thrown at it. Currently, snixembed can handle basic AppIndicator functionality (icons and menus), and may support more in the future. But not everything works. Feel free to report issues to the tracker.
As a workaround, you may start such applications with their own D-Bus
session bus. They will be unable to communicate through D-Bus with the
outside world, and therefore they won't find snixembed and fall back to the
XEmbed tray icon. To do this, execute application like this:
dbus-launch --exit-with-session <application>.
As already mentioned, this will only work for apps that don't heavily rely on other services on the session bus for functionality. Examples that have been tested to work are discord and skypeforlinux.
Alternatively, one could also choose to run snixembed on a separate session
bus, and let all SNI-only apps run on that session bus too by running
dbus-daemon --session --print-address and then setting the environment
DBUS_SESSION_BUS_ADDRESS to the address printed by dbus-daemon
for all applications that have to communicate with snixembed. This will
isolate snixembed and those applications from the rest of the D-Bus world.
As the author does not really use any non-SNI applcations, this is not well
tested or supported, but I'm happy to assist anyone going this route or look
into contributions that make this easier.
some apps probe for StatusNotifierItem support not by checking for the D-Bus
service but by checking environment variables. Exporting
KDE_SESSION_CURRENT=5 seems to do the trick.
gtk_widget_get_scale_factor: assertion 'GTK_IS_WIDGET (widget)' failed:
This error could mean that no XEmbed tray is present.