explaingit

getlantern/systray

Analysis updated 2026-07-03

3,699GoAudience · developerComplexity · 2/5LicenseSetup · moderate

TLDR

A Go library that adds a system tray icon with a menu to your desktop app on Windows, macOS, and Linux, all from a single codebase.

Mindmap

mindmap
  root((systray))
    What it does
      System tray icon
      Cross-platform menu
      Background app UI
    Platforms
      Windows
      macOS
      Linux
    Tech stack
      Go
      cgo
      C bindings
    Features
      Enable or disable items
      Checkmark items
      Per-item icons
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

What do people build with it?

USE CASE 1

Add a system tray icon to a Go background application so users can access settings or quit without a full window.

USE CASE 2

Build a cross-platform desktop tool that runs silently in the background and shows a tray menu on Windows, macOS, and Linux.

USE CASE 3

Create a tray icon that controls a web-based UI panel, using the included webview example as a starting point.

USE CASE 4

Add toggleable checkmark menu items to a system tray app to let users switch app settings on and off.

What is it built with?

GoCcgo

How does it compare?

getlantern/systrayfortio/fortioloov/lensm
Stars3,6993,6913,691
LanguageGoGoGo
Setup difficultymoderateeasyeasy
Complexity2/52/52/5
Audiencedeveloperops devopsdeveloper

Figures from each repo's GitHub metadata at analysis time.

How do you get it running?

Difficulty · moderate Time to first run · 30min

Requires cgo to be enabled and Linux users must install system-level graphics libraries before building.

Open-source and free to use, exact license terms are in the repository.

In plain English

Systray is a Go library that lets you add an icon and a menu to the system tray area of the operating system -- the small icon area near the clock on Windows, the menu bar on macOS, or the notification area on Linux. This is the region where background applications typically place themselves so the user can access settings or quit the app without the app having a full visible window. The library works across all three major desktop platforms from a single Go codebase. You provide two functions: one that runs when the app is ready (where you set the icon, tooltip, and menu items) and one that runs when the app exits. Menu items can be enabled or disabled, and they can show a checkmark. On macOS and Windows, individual menu items can also have their own icons. For developers, the setup process is straightforward on Windows and macOS, but Linux requires installing some system-level graphics libraries before building. The library requires cgo (a feature of Go that allows calling C code), so that setting needs to be enabled at build time. The repository includes a small working example application that you can compile and run to see a tray icon appear on your system right away. A separate webview example demonstrates running a tray icon alongside a web-based UI panel. The library is actively maintained by the team behind Lantern, a privacy networking tool, which is the origin of this fork. The README points to full API documentation and a changelog for developers who want to explore the complete set of options.

Copy-paste prompts

Prompt 1
Using getlantern/systray in Go, write me a minimal app that shows a system tray icon with a 'Quit' menu item.
Prompt 2
I want to build a Go background service with a system tray menu. Using systray, show me how to add menu items with icons on macOS and Windows.
Prompt 3
How do I enable or disable systray menu items dynamically in Go based on the app's state? Show a code example.
Prompt 4
Walk me through building a Go app with systray that shows a tray icon and opens a webview panel when clicked.
Prompt 5
What Linux system libraries do I need to install before building a Go app with getlantern/systray, and how do I enable cgo?

Frequently asked questions

What is systray?

A Go library that adds a system tray icon with a menu to your desktop app on Windows, macOS, and Linux, all from a single codebase.

What language is systray written in?

Mainly Go. The stack also includes Go, C, cgo.

What license does systray use?

Open-source and free to use, exact license terms are in the repository.

How hard is systray to set up?

Setup difficulty is rated moderate, with roughly 30min to a first successful run.

Who is systray for?

Mainly developer.

Open on GitHub → Explain another repo

This repo across BitVibe Labs

Scan in gitsafehub Deploy in gitdeployhub getlantern on gitmyhub

Verify against the repo before relying on details.