tray

package
v0.4.2 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 17, 2026 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Overview

Package tray puts cuxdeck in the menu bar: the mascot icon, a live status header (what's running, whether the phone can reach it), a sessions submenu, and actions whose labels say exactly what they do. It's the "it's a real app, not a terminal command" layer.

systray owns the main thread, so Run blocks; the daemon runs in the callback. Everything the menu needs from the daemon comes through the Deps struct, so this package stays free of the server/service code.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(d Deps, daemon func())

Run shows the menu-bar icon and blocks until Quit. daemon is started once the tray is ready (systray must own the main goroutine).

Types

type Deps

type Deps struct {
	// CurrentURL returns the address to open — the tunnel URL if up,
	// else the local one.
	CurrentURL func() string
	// PairingLink mints a fresh single-use pairing link to share.
	PairingLink func() string
	// Status reports the live header state; polled every few seconds.
	// nil hides the status rows entirely.
	Status func() Status
	// StartAtLoginState / SetStartAtLogin read and flip the OS
	// start-at-login registration.
	StartAtLoginState func() bool
	SetStartAtLogin   func(on bool) error
	// OnQuit runs before the process exits (graceful shutdown).
	OnQuit func()
}

Deps is what the menu needs from the rest of the app.

type Status added in v0.3.0

type Status struct {
	Machine  string   // display name of this machine
	TunnelUp bool     // phone-reachable public tunnel is live
	Sessions []string // one preformatted line per live session, oldest first
}

Status is one refresh of what the menu's header shows. Produced by the daemon side (it owns the data files); the tray only renders it.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL