hl.get_monitor¶
- hl.get_monitor(selector)¶
Get a monitor by selector.
Signature¶
hl.get_monitor(selector: HL.MonitorSelector): HL.Monitor | nil
Parameters¶
- selector
HL.MonitorSelector Monitor selector. May be a monitor output name, numeric monitor ID, or existing
HL.Monitorobject.
Returns¶
- monitor
HL.Monitoror nil Matching monitor object, or
nilif no monitor matchesselector.
Examples¶
Get a monitor by output name:
local monitor = hl.get_monitor("DP-1")
if monitor then
print(monitor.description)
end
Get a monitor by ID:
local monitor = hl.get_monitor(0)
See also¶
HL.MonitorSelectorAccepted selector values.
HL.MonitorRuntime monitor object returned by this function.
hl.get_monitors()Get all current monitor objects.
hl.get_active_monitor()Get the currently active monitor.
hl.monitor()Configure a monitor.