tray

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2026 License: AGPL-3.0, AGPL-3.0-or-later Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IconConnected

func IconConnected() []byte

IconConnected returns the green circle icon (connected to Hub).

func IconDisabled

func IconDisabled() []byte

IconDisabled returns the red circle icon (connections disabled).

func IconWaiting

func IconWaiting() []byte

IconWaiting returns the blue circle icon (waiting for connection).

Types

type Config

type Config struct {
	OnOpenWebUI    func()
	OnCopyAddress  func() string
	OnToggleAccept func(bool)
	OnQuit         func()
	GetStatus      func() Status
	OnPairingCode  func(code string) // Called when pairing code is generated
}

Config contains callbacks and getters for the tray.

type HubInfo

type HubInfo struct {
	Name string
	IP   string
}

HubInfo contains information about a connected Hub.

type Status

type Status struct {
	Running           bool
	AcceptConnections bool
	ConnectedHub      *HubInfo
	Name              string
	Address           string // "IP:Port"
}

Status represents the current agent status for the tray.

type Tray

type Tray struct {
	// contains filtered or unexported fields
}

Tray manages the system tray icon and menu.

func New

func New(cfg Config) *Tray

New creates a new Tray instance.

func (*Tray) HidePairingCode

func (t *Tray) HidePairingCode()

HidePairingCode hides the pairing code from the tray menu.

func (*Tray) Quit

func (t *Tray) Quit()

Quit signals the tray to exit.

func (*Tray) Run

func (t *Tray) Run()

Run starts the system tray. This is a blocking call that should run in a goroutine.

func (*Tray) ShowPairingCode

func (t *Tray) ShowPairingCode(code string, duration time.Duration)

ShowPairingCode displays the pairing code in the tray menu.

func (*Tray) UpdateStatus

func (t *Tray) UpdateStatus(s Status)

UpdateStatus updates the tray icon and menu based on new status.

Jump to

Keyboard shortcuts

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