MonitorInfo
Electron APIs / recorder / MonitorInfo
Information about a display monitor connected to the system.
This interface provides technical and user facing properties such as DPI, resolution, display identifiers, and whether it is the primary monitor.
Example
const monitor: MonitorInfo = {
adapterIndex: 0,
id: "MONITOR\\GSM5B10\{4d36e96e-e325-11ce-bfc1-08002be10318}_0",
altId: "DISPLAY1",
dpi: 96,
attachedToDesktop: true,
friendlyName: "LG UltraFine 4K",
refreshRate: 60,
rect: { top: 0, left: 0, width: 3840, height: 2160 },
isPrimary: true,
displayIndex: 0,
};
Properties
Property | Modifier | Type | Description |
---|---|---|---|
adapterIndex | readonly | number | Index of the GPU adapter this monitor is connected to. |
altId | readonly | string | An alternative, usually simplified, identifier (e.g., DISPLAY1). |
attachedToDesktop | readonly | boolean | Indicates whether the monitor is currently attached to the desktop. |
displayIndex | readonly | number | The display index assigned to this monitor by the system. |
dpi | readonly | number | The DPI (dots per inch) value of the monitor. |
friendlyName | readonly | string | A user-friendly name for the monitor (e.g., model name). |
id | readonly | string | The full device path or system identifier for the monitor. |
isPrimary | readonly | boolean | Whether this monitor is set as the system’s primary display. |
rect | readonly | Rect | The bounding rectangle of the monitor on the virtual screen. |
refreshRate | readonly | number | The refresh rate of the monitor in Hz. |