Documentation
¶
Overview ¶
Package tray keeps lich in the system tray: the one thing on screen that says a lich whose window is closed is still running its sessions, and the way back to the window or out of lich from there.
The menu's words are the window's: the interface language lives in the window, so the window hands its translated labels over (SetLabels), and the tray comes up with the first of them. A lich whose window never opened shows no tray, and has the error that kept it from opening on screen instead.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Icons ¶
Icons are the two encodings the platforms take: PNG for the Linux StatusNotifierItem and the macOS menu bar, ICO for the Windows notification area.
type Labels ¶
type Labels struct {
Show string `json:"show"`
Quit string `json:"quit"`
NoSessions string `json:"noSessions"`
NeedsYou string `json:"needsYou"`
Working string `json:"working"`
Idle string `json:"idle"`
More string `json:"more"`
Waiting string `json:"waiting"`
Done string `json:"done"`
ServicesRunning string `json:"servicesRunning"`
ShowOutput string `json:"showOutput"`
Restart string `json:"restart"`
Stop string `json:"stop"`
StopAll string `json:"stopAll"`
}
Labels are the menu's words, in the interface language. Idle, More and ServicesRunning carry a {count} placeholder and are written so they need no plural form.
type Services ¶ added in v0.79.0
type Services struct {
Running func() []api.Service
Reveal func(id string)
Stop func(id string)
Restart func(id string)
StopAll func()
}
Services is what the tray reads and does about the project services. Reveal opens a service's console in the window.
type Sessions ¶ added in v0.86.0
type Sessions struct {
Live func() ([]api.Peer, error)
Status func(id string) api.SessionStatus
Unread func() (map[string]bool, error)
Focus func(id string)
}
Sessions is what the tray reads and does about the sessions. Live lists the sessions with a process running, in the sidebar's order; Status is the state each last reported, as the window was told it; Unread is the set whose last turn nobody has read; Focus brings the window up on a session's card.
type Tray ¶
type Tray struct {
// contains filtered or unexported fields
}
Tray is lich's tray icon and its menu.
func (*Tray) SetLabels ¶
SetLabels gives the menu its words. The first call puts the tray up; a later one, after the language changed, rewrites the menu in place.
func (*Tray) SetServices ¶ added in v0.79.0
SetServices wires the project services into the menu. Startup wiring, called before the window can put the tray up.
func (*Tray) SetSessions ¶ added in v0.86.0
SetSessions wires the sessions into the menu. Startup wiring, called before the window can put the tray up.