GitHub - getlantern/systray: a cross platfrom Go library to place an icon and menu in the notification area · GitHub
Systray is a cross-platform Go library for creating notification-area icons and menus on Windows, macOS, and Linux. It provides goroutine-safe menu APIs, platform-specific build guidance, and requires cgo.
GitHub - getlantern/systray: a cross platfrom Go library to place an icon and menu in the notification area · GitHub
Author: getlantern | Published: Unknown | Generated: 2025-08-12 | Domain: github.com
Tags: ‘#golang’ ‘#crossplatform’ ‘#systemtray’ ‘#desktopapps’ ‘#cgo’
TLDR
getlantern/systrayis an Apache-2.0 Go library for placing an icon and interactive menu in the system notification area on Windows, macOS, and Linux. Its API supports setting icons, titles, tooltips, enabled or checked menu items, and reacting to menu events; most functions may be invoked from any goroutine. Building requires cgo, while Linux and platform packaging need additional native dependencies and configuration.
Key Takeaways
- Cross-platform tray UI: Supports Windows, macOS, and Linux, offering icon, title, tooltip, and menu-item APIs; menu items can be checked or disabled.
- Simple lifecycle model: Applications call
systray.Run(onReady, onExit); setup inonReadycan set the tray icon and add menu actions such as Quit. - cgo is mandatory: Builds require
CGO_ENABLED=1, reflecting the library’s native integrations across supported operating systems. - Linux dependencies and compatibility: Requires
gcc, GTK3, andlibayatana-appindicator3development headers; usego build -tags=legacy_appindicatorfor olderlibappindicator3. Linux Mint additionally needslibxapp-dev. - Platform-specific behavior: Windows can suppress the startup console with
-ldflags -H=windowsgui; macOS binaries should be wrapped in an application bundle and may enable cmd-drag tray-icon removal throughsystray.SetRemovalAllowed(true).
Images & Media
- Awesome App screenshot — Screenshot of the example application’s menu-bar/system-tray interface.
Referenced Links
- Systray API documentation — Full Go package API reference.
- CHANGELOG — Version history and release changes.
- Official Apple bundle documentation — Guidance for packaging a macOS application bundle.
- NSStatusItemBehavior documentation — Apple API underlying configurable macOS status-item removal behavior.
- xilp/systray — Credited predecessor project.
- cratonica/trayhost — Credited tray-host project.