# desktop-idle

> Node/Electron module to detect idle desktop users(users away from keyboard) in macOS, Windows, Linux, FreeBSD and OpenBSD

Latest version **1.3.0** (published 2019-11-25) · MIT license · 0 weekly downloads

## Install

```sh
npm install desktop-idle
pnpm add desktop-idle
yarn add desktop-idle
bun add desktop-idle
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.0 |
| Published | 2019-11-25 |
| First published | 2017-09-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=7.9.0 |
| Dependencies | 0 |
| Unpacked size | 78.8 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| GitHub stars | 100 |
| Maintainers | bithavoc |
| Keywords | idle, desktop, electron, away, afk |

## Links

- npm: https://www.npmjs.com/package/desktop-idle
- Repository: https://github.com/bithavoc/node-desktop-idle
- Issues: https://github.com/bithavoc/node-desktop-idle/issues
- npm.io page: https://npm.io/package/desktop-idle

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.3.0 (latest) — 2019-11-25
- 1.2.0 — 2019-06-17
- 1.1.2 — 2018-08-14
- 1.1.1 — 2017-12-07
- 1.1.0 — 2017-11-17
- 1.0.0 — 2017-09-09

## README

## desktop idle
> [![Build status](https://ci.appveyor.com/api/projects/status/gwlnytjjw4ju3vs0?svg=true)](https://ci.appveyor.com/project/bithavoc/node-desktop-idle)
> [![Build Status](https://travis-ci.org/bithavoc/node-desktop-idle.svg?branch=master)](https://travis-ci.org/bithavoc/node-desktop-idle)
> [![Monthly Downloads](https://img.shields.io/npm/dm/desktop-idle.svg)](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<im@bithavoc.io>`

---
_Source: https://npm.io/package/desktop-idle · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
