Skip to content

Commit

Permalink
DPMS getting correctly disabled (#535)
Browse files Browse the repository at this point in the history
* DPMS getting correctly disabled

* get timeout back to 5 minutes
  • Loading branch information
UnchartedBull committed Mar 31, 2020
1 parent 98b9ecc commit 0cc11a3
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions main.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
/* eslint-disable @typescript-eslint/no-var-requires */
const { app, BrowserWindow } = require('electron');
const {
app,
BrowserWindow
} = require('electron');
const url = require('url');
const path = require('path');
const Store = require('electron-store');

const store = new Store();
const exec = require('child_process').exec;
const { ipcMain } = require('electron');
const {
ipcMain
} = require('electron');

const args = process.argv.slice(1);
const dev = args.some(val => val === '--serve');
Expand All @@ -22,7 +27,9 @@ function createWindow() {
config = newValue;
});

const { screen } = require('electron');
const {
screen
} = require('electron');
const mainScreen = screen.getPrimaryDisplay();
window = new BrowserWindow({
width: dev ? (big ? 1400 : 1080) : mainScreen.size.width,
Expand Down Expand Up @@ -67,7 +74,9 @@ function activateScreenSleepListener() {
});

ipcMain.on('screenWakeup', () => {
exec('xset s off');
exec('xset -dpms');
exec('xset s noblank');
});
}

Expand Down

0 comments on commit 0cc11a3

Please sign in to comment.