Documentation
¶
Overview ¶
Package monitor reports connected display information for the jarvisfriends devices-* family: EDID identity (make, model, size, native resolution, serial) as static values, and the live mode (resolution, refresh rate) as dynamic ones. Works without cgo on Windows and Linux.
Both platforms ultimately hand over the same artifact — the display's 128-byte EDID block — so one parser (edid.go) serves both. Linux reads it from /sys/class/drm; Windows lists active monitors via WMI and reads each EDID from the PnP registry. Live modes come from user32 display syscalls on Windows; on Linux they need a display-server query, reported as a gap until that lands.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Collector ¶
type Collector struct{}
Collector implements devices.Collector for the monitor category.
type EDID ¶
type EDID struct {
// Manufacturer is the three-letter PNP vendor code ("DEL", "GSM", "SAM").
Manufacturer string
ProductCode uint16
SerialNumber uint32
// SerialString is the serial from the descriptor block, when present —
// usually the one printed on the label.
SerialString string
// Name is the model name descriptor ("DELL U2723QE").
Name string
Year int
Week int
// WidthCm and HeightCm are the physical image size.
WidthCm int
HeightCm int
// PreferredWidth and PreferredHeight are the native mode's pixels.
PreferredWidth int
PreferredHeight int
}
EDID is the decoded identity block a display reports about itself. Both platforms hand us the same 128-byte base block — Linux via /sys/class/drm/*/edid, Windows via the PnP registry — so one parser covers them. (No maintained Go EDID library exists; the format is a fixed, well-documented 128-byte structure, which makes this the rare case where writing it ourselves beats vendoring an abandoned one.)
func ParseEDID ¶
ParseEDID decodes the 128-byte EDID base block. Extension blocks carry audio/HDR/colorimetry details this category doesn't report, so they are ignored.
func (*EDID) DiagonalInches ¶
DiagonalInches computes the physical diagonal from the EDID image size, zero when the display didn't report one (projectors, some laptop panels).
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
devices-monitor
command
Command devices-monitor reports connected display identity and live modes using the shared devices-common CLI: one-shot, --json, --tui, --web.
|
Command devices-monitor reports connected display identity and live modes using the shared devices-common CLI: one-shot, --json, --tui, --web. |