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"`
Running string `json:"running"`
Quit string `json:"quit"`
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. Running carries a {count} placeholder and is written so it needs 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 Tray ¶
type Tray struct {
// contains filtered or unexported fields
}
Tray is lich's tray icon and its menu.
func New ¶
New returns a tray that is not up yet. show brings the window up, quit ends lich, live counts the sessions with a process running.
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.