desktop-idle
v1.3.0
Published
Node/Electron module to detect idle desktop users(users away from keyboard) in macOS, Windows, Linux, FreeBSD and OpenBSD
Downloads
273
Readme
desktop idle
Node/Electron module to detect idle desktop users (macOS, Windows, Linux, FreeBSD and OpenBSD).
Stable | Actively maintained | Pull Requests Welcome
Forked and inspired from node-system-idle-time
Installation
npm install --save desktop-idle
# or yarn
yarn add desktop-idle
Cross-Platform Support
- Windows: GetLastInputInfo, see
src/win/idle.cc
. - Mac(OSX): CoreGraphics Event Source, see
src/mac/idle.cc
. - Linux & FreeBSD & OpenBSD: X Screensaver, see
src/linux/idle.cc
.
Usage
var desktopIdle = require('desktop-idle');
console.log(desktopIdle.getIdleTime());
Linux Requirements
X server development package and pkg-config are required:
apt install libxss-dev pkg-config
Test
yarn test
License
MIT - Bithavoc<[email protected]>