hammerspoon2-docs
    Preparing search index...

    Namespace screen

    Inspect and control the displays attached to the system.

    const all    = hs.screen.all();   // [HSScreen, ...]
    const main = hs.screen.main(); // screen containing the focused window
    const primary = hs.screen.primary(); // screen with the global menu bar
    const right = hs.screen.main().toEast();
    if (right) console.log("Screen to the right:", right.name);
    const s = hs.screen.primary();
    console.log(s.mode);
    // → { width: 1440, height: 900, scale: 2, frequency: 60 }

    s.setMode(1920, 1080, 1, 60);
    const img = await hs.screen.main().snapshot();
    img.saveToFile("/tmp/screen.png");

    Functions

    all
    main
    primary