mainscreen
mjolnir.screen.mainscreen() -> screen
Returns the 'main' screen, i.e. the one containing the currently focused window.
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.
mjolnir.screen.allscreens() -> screen[]
Returns all the screens there are.
mjolnir.screen.mainscreen() -> screen
Returns the 'main' screen, i.e. the one containing the currently focused window.
mjolnir.screen.settint(redarray, greenarray, bluearray)
Set the tint on a screen; experimental.
mjolnir.screen:frame() -> rect
Returns the screen's rect in absolute coordinates, without the dock or menu.
mjolnir.screen:fullframe() -> rect
Returns the screen's rect in absolute coordinates, including the dock and menu.
mjolnir.screen:id(screen) -> number
Returns a screen's unique ID.
mjolnir.screen:name(screen) -> string
Returns the preferred name for the screen set by the manufacturer.
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.
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.
mjolnir.screen:toeast()
Get the first screen to the east of this one, ordered by proximity.
mjolnir.screen:tonorth()
Get the first screen to the north of this one, ordered by proximity.
mjolnir.screen:tosouth()
Get the first screen to the south of this one, ordered by proximity.
mjolnir.screen:towest()
Get the first screen to the west of this one, ordered by proximity.