mjolnir.screen

Manipulate screens (i.e. monitors).

You usually get a screen through a window (see mjolnir.window.screen). But you can get screens by themselves through this module, albeit not in any defined/useful order.

Mjolnir's coordinate system assumes a grid that is the union of every screen's rect (see mjolnir.screen.fullframe).

Every window's position (i.e. topleft) and size are relative to this grid, and they're usually within the grid. A window that's semi-offscreen only intersects the grid.

allscreens

mjolnir.screen.allscreens() -> screen[]

Returns all the screens there are.

mainscreen

mjolnir.screen.mainscreen() -> screen

Returns the 'main' screen, i.e. the one containing the currently focused window.

settint

mjolnir.screen.settint(redarray, greenarray, bluearray)

Set the tint on a screen; experimental.

frame

mjolnir.screen:frame() -> rect

Returns the screen's rect in absolute coordinates, without the dock or menu.

fullframe

mjolnir.screen:fullframe() -> rect

Returns the screen's rect in absolute coordinates, including the dock and menu.

id

mjolnir.screen:id(screen) -> number

Returns a screen's unique ID.

name

mjolnir.screen:name(screen) -> string

Returns the preferred name for the screen set by the manufacturer.

next

mjolnir.screen:next() -> screen

Returns the screen 'after' this one (I have no idea how they're ordered though); this method wraps around to the first screen.

previous

mjolnir.screen:previous() -> screen

Returns the screen 'before' this one (I have no idea how they're ordered though); this method wraps around to the last screen.

toeast

mjolnir.screen:toeast()

Get the first screen to the east of this one, ordered by proximity.

tonorth

mjolnir.screen:tonorth()

Get the first screen to the north of this one, ordered by proximity.

tosouth

mjolnir.screen:tosouth()

Get the first screen to the south of this one, ordered by proximity.

towest

mjolnir.screen:towest()

Get the first screen to the west of this one, ordered by proximity.