Documentation
¶
Overview ¶
Package x11tray provides system tray functionality for Unix platforms. It handles StatusNotifierItem integration via DBus and manages the snixembed proxy for compatibility with legacy X11 system trays.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HealthCheck ¶
func HealthCheck() error
HealthCheck verifies that a system tray implementation is available via D-Bus. It checks for the KDE StatusNotifierWatcher service which is required for system tray icons on modern Linux desktops.
Returns nil if a tray is available, or an error describing the issue.
func ShowContextMenu ¶
func ShowContextMenu()
ShowContextMenu triggers the context menu via DBus on Unix platforms. On Linux/FreeBSD with StatusNotifierItem, the menu parameter in click handlers is nil, so we need to manually call the ContextMenu method via DBus to show the menu.
Types ¶
type ProxyProcess ¶
type ProxyProcess struct {
// contains filtered or unexported fields
}
ProxyProcess represents a running snixembed background process.
func EnsureTray ¶
func EnsureTray(ctx context.Context) (*ProxyProcess, error)
EnsureTray checks for system tray availability and attempts to start a proxy if needed. This is a convenience function that combines HealthCheck and TryProxy.
Returns a ProxyProcess if one was started (caller must Stop() it on exit), or nil if the native tray was available. Returns an error if no tray solution could be found.
func TryProxy ¶
func TryProxy(ctx context.Context) (*ProxyProcess, error)
TryProxy attempts to start snixembed as a system tray proxy service. snixembed bridges legacy X11 system trays to modern StatusNotifier-based trays.
If successful, returns a ProxyProcess that should be stopped when the application exits. Returns an error if snixembed is not found or fails to start successfully.
func (*ProxyProcess) Stop ¶
func (p *ProxyProcess) Stop() error
Stop terminates the proxy process gracefully.