Search tldr

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.

Share

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/systray is 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 in onReady can 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, and libayatana-appindicator3 development headers; use go build -tags=legacy_appindicator for older libappindicator3. Linux Mint additionally needs libxapp-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 through systray.SetRemovalAllowed(true).

Images & Media

Keep reading