<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>docs/config/lua/wezterm.gui/screens.md - fork/wezterm @ termwiz-0.23.0</title>
<meta name="description" content="docs/config/lua/wezterm.gui/screens.md in fork/wezterm at termwiz-0.23.0.">
<meta property="og:title" content="docs/config/lua/wezterm.gui/screens.md - fork/wezterm @ termwiz-0.23.0">
<meta property="og:description" content="docs/config/lua/wezterm.gui/screens.md in fork/wezterm at termwiz-0.23.0.">
<meta property="og:type" content="website">
<meta property="og:site_name" content="git.julia.blue">
<link rel="stylesheet" href="/css/style.css?v=62">
<script type="module" src="/js/main.js?v=62"></script>
</head>
<body>
<main data-ref="termwiz-0.23.0" data-tip="958804c8ac16b750954b3bcaaf847e7498cd2205">
<noscript>
  <div class="callout">
    <p>
      hey! this is a static git repo viewer. commit diffs, file history,
      older commits and other revisions won't load without javascript.
    </p>
    <p>
      you are still able to view source files on branch/tag tips,
      but the experience is degraded.
    </p>
  </div>
</noscript>
<header class="repo"><div>
<h1>fork/wezterm</h1>
</div>
<pre class="clone">git clone https://git.julia.blue/fork/wezterm</pre>
</header>
<p class="snapshot-commit"><span class="commit-author">Wez Furlong</span><span class="commit-message" data-commit="40081cb5737da32058a3c87e14b84d8f2bfefdc4">docs: update a bunch of since lines to new macro</span><span class="snapshot-sha sha" data-commit="40081cb5737da32058a3c87e14b84d8f2bfefdc4">40081cb57</span><time datetime="2023-03-20T22:01:24-07:00" title="2023-03-20 22:01:24 -0700">2023-03-20</time></p>
<header class="topbar"><details class="switcher"><summary>termwiz-0.23.0</summary><div class="menu"><strong>branches</strong><a href="/fork/wezterm/ref/main/">main</a><strong>tags</strong><a href="/fork/wezterm/ref/termiz-0.23.1/">termiz-0.23.1</a><a href="/fork/wezterm/ref/termiz-0.23.2/">termiz-0.23.2</a><a href="/fork/wezterm/ref/termiz-0.23.3/">termiz-0.23.3</a><a class="current" href="/fork/wezterm/ref/termwiz-0.23.0/">termwiz-0.23.0</a><a href="/fork/wezterm/ref/termwiz-0.23.1/">termwiz-0.23.1</a><a href="/fork/wezterm/ref/termwiz-0.23.2/">termwiz-0.23.2</a><a href="/fork/wezterm/ref/termwiz-0.23.3/">termwiz-0.23.3</a><a href="/fork/wezterm/ref/vtparse-0.7.0/">vtparse-0.7.0</a><a class="all" href="/fork/wezterm/refs">all refs →</a></div></details><nav class="crumbs"><a href="/fork/wezterm/">wezterm</a> / <a href="/fork/wezterm/ref/termwiz-0.23.0/tree/docs/">docs</a> / <a href="/fork/wezterm/ref/termwiz-0.23.0/tree/docs/config/">config</a> / <a href="/fork/wezterm/ref/termwiz-0.23.0/tree/docs/config/lua/">lua</a> / <a href="/fork/wezterm/ref/termwiz-0.23.0/tree/docs/config/lua/wezterm.gui/">wezterm.gui</a> / <span class="cur">screens.md</span></nav>
<span class="view-stats"><span>1.8 KiB</span><span>55 lines</span></span><span class="actions"><a class="raw" href="/fork/wezterm/raw/7d19ab90389721323c6bf0a4471e01e1cb5a6bb1/docs/config/lua/wezterm.gui/screens.md">raw</a></span></header>
<div class="markdown-view"><input type="radio" name="markdown-view" id="markdown-rendered" checked><label for="markdown-rendered">rendered</label><input type="radio" name="markdown-view" id="markdown-code"><label for="markdown-code">code</label><section class="readme rendered"><h1><code>wezterm.gui.screens()</code></h1>
<p>{{since('20220807-113146-c2fee766')}}</p>
<p>Returns information about the screens connected to the system.</p>
<p>The follow example was typed into the <a href="/fork/wezterm/ref/termwiz-0.23.0/blob/docs/config/lua/keyassignment/ShowDebugOverlay.md">Debug
Overlay</a> (by default: press
<code>CTRL-SHIFT-L</code>) on a macbook:</p>
<pre>&gt; wezterm.gui.screens()
{
    &quot;active&quot;: {
        &quot;height&quot;: 1800,
        &quot;name&quot;: &quot;Built-in Retina Display&quot;,
        &quot;width&quot;: 2880,
        &quot;x&quot;: 0,
        &quot;y&quot;: 0,
    },
    &quot;by_name&quot;: {
        &quot;Built-in Retina Display&quot;: {
            &quot;height&quot;: 1800,
            &quot;name&quot;: &quot;Built-in Retina Display&quot;,
            &quot;width&quot;: 2880,
            &quot;x&quot;: 0,
            &quot;y&quot;: 0,
        },
    },
    &quot;main&quot;: {
        &quot;height&quot;: 1800,
        &quot;name&quot;: &quot;Built-in Retina Display&quot;,
        &quot;width&quot;: 2880,
        &quot;x&quot;: 0,
        &quot;y&quot;: 0,
    },
    &quot;origin_x&quot;: 0,
    &quot;origin_y&quot;: 0,
    &quot;virtual_height&quot;: 1800,
    &quot;virtual_width&quot;: 2880,
}
</pre>
<p>The return value is a table with the following keys:</p>
<ul>
<li><code>active</code> - contains information about the <em>active</em> screen. The active screen is the one which has input focus. On some systems, wezterm will return the same information as the <code>main</code> screen screen.</li>
<li><code>main</code> - contains information about the <em>main</em> screen. The main screen is the primary screen: the one that has the menu bar or task bar.</li>
<li><code>by_name</code> - a table containing information about each screen, indexed by their name</li>
<li><code>origin_x</code>, <code>origin_y</code>, <code>virtual_height</code>, <code>virtual_width</code> - the bounds of the combined desktop geometry spanning all connected screens</li>
</ul>
<p>The screen information is a table with the following keys:</p>
<ul>
<li><code>name</code> - the name of the screen.</li>
<li><code>x</code>, <code>y</code>, <code>width</code>, <code>height</code> - the bounds of this screen</li>
<li><code>max_fps</code> - the maximum refresh rate supported by the screen, if known, or <code>nil</code> otherwise. {{since('20220903-194523-3bb1ed61', inline=True)}}</li>
</ul>
</section><div class="code-panel"><pre class="code src language-markdown"><span class="code-line"><a class="ln" id="L1" href="#L1">1</a><span class="code-text"><a-p>#</a-p> <a-tt>`wezterm.gui.screens()`</a-tt></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L2" href="#L2">2</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L3" href="#L3">3</a><span class="code-text">{{since(&#39;20220807-113146-c2fee766&#39;)}}</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L4" href="#L4">4</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L5" href="#L5">5</a><span class="code-text">Returns information about the screens connected to the system.</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L6" href="#L6">6</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L7" href="#L7">7</a><span class="code-text">The follow example was typed into the [Debug</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L8" href="#L8">8</a><span class="code-text">Overlay](../keyassignment/ShowDebugOverlay.md) (by default: press</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L9" href="#L9">9</a><span class="code-text">`CTRL-SHIFT-L`) on a macbook:</span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L10" href="#L10">10</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L11" href="#L11">11</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L12" href="#L12">12</a><span class="code-text"><a-p>&gt; wezterm.gui.screens()</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L13" href="#L13">13</a><span class="code-text"><a-p>{</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L14" href="#L14">14</a><span class="code-text"><a-p>    &quot;active&quot;: {</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L15" href="#L15">15</a><span class="code-text"><a-p>        &quot;height&quot;: 1800,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L16" href="#L16">16</a><span class="code-text"><a-p>        &quot;name&quot;: &quot;Built-in Retina Display&quot;,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L17" href="#L17">17</a><span class="code-text"><a-p>        &quot;width&quot;: 2880,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L18" href="#L18">18</a><span class="code-text"><a-p>        &quot;x&quot;: 0,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L19" href="#L19">19</a><span class="code-text"><a-p>        &quot;y&quot;: 0,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L20" href="#L20">20</a><span class="code-text"><a-p>    },</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L21" href="#L21">21</a><span class="code-text"><a-p>    &quot;by_name&quot;: {</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L22" href="#L22">22</a><span class="code-text"><a-p>        &quot;Built-in Retina Display&quot;: {</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L23" href="#L23">23</a><span class="code-text"><a-p>            &quot;height&quot;: 1800,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L24" href="#L24">24</a><span class="code-text"><a-p>            &quot;name&quot;: &quot;Built-in Retina Display&quot;,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L25" href="#L25">25</a><span class="code-text"><a-p>            &quot;width&quot;: 2880,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L26" href="#L26">26</a><span class="code-text"><a-p>            &quot;x&quot;: 0,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L27" href="#L27">27</a><span class="code-text"><a-p>            &quot;y&quot;: 0,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L28" href="#L28">28</a><span class="code-text"><a-p>        },</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L29" href="#L29">29</a><span class="code-text"><a-p>    },</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L30" href="#L30">30</a><span class="code-text"><a-p>    &quot;main&quot;: {</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L31" href="#L31">31</a><span class="code-text"><a-p>        &quot;height&quot;: 1800,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L32" href="#L32">32</a><span class="code-text"><a-p>        &quot;name&quot;: &quot;Built-in Retina Display&quot;,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L33" href="#L33">33</a><span class="code-text"><a-p>        &quot;width&quot;: 2880,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L34" href="#L34">34</a><span class="code-text"><a-p>        &quot;x&quot;: 0,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L35" href="#L35">35</a><span class="code-text"><a-p>        &quot;y&quot;: 0,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L36" href="#L36">36</a><span class="code-text"><a-p>    },</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L37" href="#L37">37</a><span class="code-text"><a-p>    &quot;origin_x&quot;: 0,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L38" href="#L38">38</a><span class="code-text"><a-p>    &quot;origin_y&quot;: 0,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L39" href="#L39">39</a><span class="code-text"><a-p>    &quot;virtual_height&quot;: 1800,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L40" href="#L40">40</a><span class="code-text"><a-p>    &quot;virtual_width&quot;: 2880,</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L41" href="#L41">41</a><span class="code-text"><a-p>}</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L42" href="#L42">42</a><span class="code-text"><a-p>```</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L43" href="#L43">43</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L44" href="#L44">44</a><span class="code-text"><a-p>The return value is a table with the following keys:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L45" href="#L45">45</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L46" href="#L46">46</a><span class="code-text"><a-p>* `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.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L47" href="#L47">47</a><span class="code-text"><a-p>* `main` - contains information about the *main* screen. The main screen is the primary screen: the one that has the menu bar or task bar.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L48" href="#L48">48</a><span class="code-text"><a-p>* `by_name` - a table containing information about each screen, indexed by their name</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L49" href="#L49">49</a><span class="code-text"><a-p>* `origin_x`, `origin_y`, `virtual_height`, `virtual_width` - the bounds of the combined desktop geometry spanning all connected screens</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L50" href="#L50">50</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L51" href="#L51">51</a><span class="code-text"><a-p>The screen information is a table with the following keys:</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L52" href="#L52">52</a><span class="code-text"></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L53" href="#L53">53</a><span class="code-text"><a-p>* `name` - the name of the screen.</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L54" href="#L54">54</a><span class="code-text"><a-p>* `x`, `y`, `width`, `height` - the bounds of this screen</a-p></span><span class="code-break">
</span></span><span class="code-line"><a class="ln" id="L55" href="#L55">55</a><span class="code-text"><a-p>* </a-p>`max_fps` - the maximum refresh rate supported by the screen, if known, or `nil` otherwise. {{since(&#39;20220903-194523-3bb1ed61&#39;, inline=True)}}</span></span></pre></div></div>
</main>
</body>
</html>
