Skip to content

Instantly share code, notes, and snippets.

View S-unya's full-sized avatar
💭
Exploring

Sunya Dickman S-unya

💭
Exploring
  • Aer Studios
  • UK
View GitHub Profile
@S-unya
S-unya / init.js
Created November 25, 2015 10:29
Create NWjs kiosk that spans multiple displays in OSX
/**
* There may be a better way to do this and I'd love to hear of them. This technique revolves around 2 specifics:
* 1. In OSX Mavericks+ you need to set the displays to not have their own "space"; I have bruted this by adding a cmd
* to actually write this preference on each app start. Needless to say this should NOT be done to an unsuspecting user...
* 2. Kiosk mode should be set BEFORE setting the width and height of your window. Below I include a function that will calculate
* all available space and position the window relatively to the "main" screen.
*/
// require the GUI object so that we can access Window and Screen
var gui = require("nw.gui");