screensaver-trigger
v2.1.0
Published
Trigger a callback when user has not interacted with computer for a period of time, then wait for any interaction
Downloads
6
Maintainers
Readme
Screensaver trigger (for nodejs)
Trigger a callback when user has not interacted with computer for a period of time, then wait for any interaction.
- under win32, relies on MS Windows GetLastInputTime (through [node winapi] (https://www.npmjs.com/package/winapi) )
- under linux, relies on node-x11
API
var screensaver = require('screensaver-trigger');
// start a screensaver after 10s on inactity
(function stuff(){
screensaver(10 * 1000, function(){
console.log("Screensaver start");
}, function() {
console.log("Screensaver end");
stuff(); //do it again !
})
})();
Credits
Keywords / shout box
screensaver, windows api, x11, GetLastInputInfo, activity monitor, inactivity trigger, idle timer