Skip to content

Commit

Permalink
add screen stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
willswire committed Mar 1, 2019
1 parent 879f059 commit 3ff9837
Show file tree
Hide file tree
Showing 7 changed files with 33 additions and 28 deletions.
Empty file modified .gitignore
100644 → 100755
Empty file.
Empty file modified CHANGELOG.md
100644 → 100755
Empty file.
Empty file modified README.md
100644 → 100755
Empty file.
Empty file modified docker-compose.yml
100644 → 100755
Empty file.
61 changes: 33 additions & 28 deletions electron/app/main.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
// Declare constants required for ElectronJS to run properly
const electron = require('electron');
const {
app,
BrowserWindow,
app,
BrowserWindow,
} = electron;

let mainWindow;
Expand All @@ -14,36 +14,41 @@ var currentTime = 0;
var currentTimeout = 0;

// Slide changing Function
var slideChanger = function() {
mainWindow.loadURL(SLIDE_URLS[currentSlide % SLIDE_URLS.length]);
currentTimeout = parseInt(TIMEOUT[currentTime % TIMEOUT.length]) * 1000;
currentSlide++;
currentTime++;
setTimeout(slideChanger, currentTimeout);
var slideChanger = function () {
mainWindow.loadURL(SLIDE_URLS[currentSlide % SLIDE_URLS.length]);
currentTimeout = parseInt(TIMEOUT[currentTime % TIMEOUT.length]) * 1000;
currentSlide++;
currentTime++;
setTimeout(slideChanger, currentTimeout);
}

// Main Function
app.on('ready', () => {

mainWindow = new BrowserWindow({
width: 1920,
height: 1080,
frame: false,
kiosk: true,
webPreferences: {
sandbox: false,
overlayScrollbars: false,
nodeIntegration: false,
allowRunningInsecureContent: true,
plugins: true,
nativeWindowOpen: true
}
});

process.on('uncaughtException', (err) => {
console.log(err);
});

setTimeout(slideChanger, currentTimeout);
var screenElectron = electron.screen;
var mainScreen = screenElectron.getPrimaryDisplay();
var dimensions = mainScreen.size;
console.log("The screen dimensions are: " + dimensions.width + "x" + dimensions.height);

mainWindow = new BrowserWindow({
width: dimensions.width,
height: dimensions.height,
frame: false,
kiosk: true,
webPreferences: {
sandbox: false,
overlayScrollbars: false,
nodeIntegration: false,
allowRunningInsecureContent: true,
plugins: true,
nativeWindowOpen: true
}
});

process.on('uncaughtException', (err) => {
console.log(err);
});

setTimeout(slideChanger, currentTimeout);

});
Empty file modified vnc/Dockerfile.template
100644 → 100755
Empty file.
Empty file modified vnc/start.sh
100644 → 100755
Empty file.

0 comments on commit 3ff9837

Please sign in to comment.