Skip to content

Monitor

The return result of monitor functions

Attributes:

Methods:

attr connector

connector: string|nil

Type: string|nil

attr description

description: string|nil

Type: string|nil

attr device

device: string

Type: string

attr device_id

device_id: string

Type: string

attr geometry

geometry: MonitorGeometry

attr id

id: number

Type: number

attr is_primary

is_primary: boolean

Type: boolean

attr manufacturer

manufacturer: string|nil

Type: string|nil

attr model

model: string|nil

Type: string|nil

attr name

name: string

Type: string

attr refresh_rate

refresh_rate: number

Type: number

This value is in millihertz (mHz) not hertz (Hz)

attr scale_factor

scale_factor: MonitorScaleFactor

method attach

function attach(props: BarProps) -> Bar

Attaches a component on the monitor.

Example

local monitors = hitokage.monitor.get_all()

for _, monitor in ipairs(monitors) do
  monitor:attach({
    children = {
      { Box = {} },
      { Workspace = { halign = "Center", item_height = 22, item_width = 22 } },
      { Clock = { format = "%a %b %u %r", halign = 'End' } },
    },
  })
end

Parameters:

  • props

    (BarProps) — A table specifying the shape of the bar

Returns:

  • Bar — A Bar userdata