Documentation
¶
Overview ¶
Package osd is the on-screen display (lys-shell osd/): one layer surface on the configured monitor flashing volume, microphone, brightness, and lock-key events and the toasts `lys-shell toast` pushes, styled by the stylesheet's .osd rules and dismissed after osd.duration.
Index ¶
Constants ¶
const BrightnessIcon = "ld-sun-symbolic"
BrightnessIcon is the brightness slider's glyph (BRIGHTNESS_ICON).
Variables ¶
This section is empty.
Functions ¶
func MicrophoneIcon ¶
MicrophoneIcon is the input slider's glyph.
func VolumeIcon ¶
VolumeIcon is the output slider's glyph (methods.rs volume_icon).
Types ¶
type Deps ¶
type Deps struct {
// Open maps a layer surface.
Open func(app.LayerConfig) (Window, error)
// Outputs lists the connected outputs, the primary first.
Outputs func() []*app.Output
// Invoke runs fn on the UI loop.
Invoke func(fn func())
// After runs fn once d has passed, off the loop.
After func(d time.Duration, fn func())
// Sheet styles the surface: the labels and icons take their ink
// from its cascade. Font is the labels' face.
Sheet *widget.Stylesheet
Font render.Font
}
Deps are the OSD's collaborators.
type Event ¶
type Event struct {
// contains filtered or unexported fields
}
Event is one OSD flash (messages.rs OsdEvent): a slider (volume, microphone, brightness), a lock-key toggle, or a toast pushed over the widget socket. Build one with Slider, Toggle, or from a toast request.
type Osd ¶
type Osd struct {
// contains filtered or unexported fields
}
Osd is the display. Its exported methods may be called from any goroutine; its state lives on the UI loop.
func (*Osd) DetachOutput ¶
DetachOutput drops the surface on an unplugged output; the next event maps it on the configured monitor again.
func (*Osd) SetConfig ¶
SetConfig takes a reloaded config; a mapped OSD re-anchors to it (OsdCmd::ConfigChanged).
func (*Osd) ShowToast ¶
func (o *Osd) ShowToast(req widgetipc.ToastRequest)
ShowToast flashes a `lys-shell toast` request (handle_show_toast).