1
1
mirror of https://github.com/wez/wezterm.git synced 2024-12-29 00:21:57 +03:00
wezterm/docs/config/lua/wezterm.gui/screens.md

1.6 KiB

wezterm.gui.screens()

Since: nightly builds only

Returns information about the screens connected to the system.

The follow example was typed into the Debug Overlay (by default: press CTRL-SHIFT-L) on a macbook:

> wezterm.gui.screens()
{
    "active": {
        "height": 1800,
        "name": "Built-in Retina Display",
        "width": 2880,
        "x": 0,
        "y": 0,
    },
    "by_name": {
        "Built-in Retina Display": {
            "height": 1800,
            "name": "Built-in Retina Display",
            "width": 2880,
            "x": 0,
            "y": 0,
        },
    },
    "main": {
        "height": 1800,
        "name": "Built-in Retina Display",
        "width": 2880,
        "x": 0,
        "y": 0,
    },
    "origin_x": 0,
    "origin_y": 0,
    "virtual_height": 1800,
    "virtual_width": 2880,
}

The return value is a table with the following keys:

  • active - contains information about the active screen. The active screen is the one which has input focus. On some systems, wezterm will return the same information as the main screen screen.
  • main - contains information about the main screen. The main screen is the primary screen: the one that has the menu bar or task bar.
  • by_name - a table containing information about each screen, indexed by their name
  • origin_x, origin_y, virtual_height, virtual_width - the bounds of the combined desktop geometry spanning all connected screens

The screen information is a table with the following keys:

  • name - the name of the screen.
  • x, y, width, height - the bounds of this screen