https://github.com/bithavoc/node-desktop-idle
Node/Electron module to detect idle desktop user (macOS, Windows, Linux, FreeBSD and OpenBSD)
https://github.com/bithavoc/node-desktop-idle
desktop electron idle native node
Last synced: 8 months ago
JSON representation
Node/Electron module to detect idle desktop user (macOS, Windows, Linux, FreeBSD and OpenBSD)
- Host: GitHub
- URL: https://github.com/bithavoc/node-desktop-idle
- Owner: bithavoc
- License: mit
- Created: 2017-09-08T15:53:53.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2023-01-12T09:59:44.000Z (over 3 years ago)
- Last Synced: 2025-10-12T23:07:22.767Z (8 months ago)
- Topics: desktop, electron, idle, native, node
- Language: Python
- Homepage:
- Size: 170 KB
- Stars: 98
- Watchers: 2
- Forks: 29
- Open Issues: 16
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## desktop idle
> [](https://ci.appveyor.com/project/bithavoc/node-desktop-idle)
> [](https://travis-ci.org/bithavoc/node-desktop-idle)
> [](https://www.npmjs.com/package/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](https://github.com/paulcbetts/node-system-idle-time)_
### Installation
```
npm install --save desktop-idle
# or yarn
yarn add desktop-idle
```
### Cross-Platform Support
* **Windows:** [GetLastInputInfo](https://msdn.microsoft.com/en-us/library/windows/desktop/ms646302(v=vs.85).aspx), see `src/win/idle.cc`.
* **Mac(OSX):** [CoreGraphics Event Source](https://developer.apple.com/documentation/coregraphics/1408790-cgeventsourcesecondssincelasteve), see `src/mac/idle.cc`.
* **Linux & FreeBSD & OpenBSD:** [X Screensaver](https://linux.die.net/man/3/xscreensaverqueryinfo), 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`