Reputation: 927
I, I'm writing an app with electron (http://electron.atom.io/). I would like to deactivate the monitor/display of the pc and only activate it again, when something in the app happens (for energy-saving). Is there a way to do this? The only think I found, is the powerSaveBlocker (http://electron.atom.io/docs/api/power-save-blocker/) which doesn't help me...
Upvotes: 3
Views: 1223
Reputation: 1559
One of the ways you can do that is by executing batch files from electron/node in Windows , shell scripts in Linux and whatever MAC OS uses to execute commands.
These scripts would contain the OS level commands to turn on/off the display which are easily available .
When to fire these scripts would depend on your application logic .
Upvotes: 0
Reputation: 14847
You'll need to use native system APIs to do this, on Windows you can use one of the solutions proposed in Turn on/off monitor.
Upvotes: 2