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 page's: the interface language lives in the page, so the page hands its translated labels over (SetLabels), and the tray comes up with the first of them. A lich whose page never loaded shows no tray, and has its window, or 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, ICO for the Windows notification area.
type Labels ¶
type Labels struct {
Show string `json:"show"`
Running string `json:"running"`
Quit string `json:"quit"`
// OpenNative and OpenWeb open the window Show does not.
OpenNative string `json:"openNative"`
OpenWeb string `json:"openWeb"`
}
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 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) SetOtherWindow ¶
SetOtherWindow adds the item that opens the window Show does not, chosen reading which one Show opens. Called before the tray is up.