# mezon-active-windows

> Get information about active windows and idle time on Windows, Linux and MacOS

Latest version **0.1.39** (published 2026-01-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install mezon-active-windows
pnpm add mezon-active-windows
yarn add mezon-active-windows
bun add mezon-active-windows
```

## Health

**Score 45/100 (D)** — status: stable.

Positive: no vulnerabilities.

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

## Facts

| | |
|---|---|
| Version | 0.1.39 |
| Published | 2026-01-23 |
| First published | 2024-11-09 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 16 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Author | Nguyen Tran Nhan |
| Maintainers | nguyentrannhan |
| Keywords | current-window, window-manager, xorg, active-window, window |

## Links

- npm: https://www.npmjs.com/package/mezon-active-windows
- Repository: https://github.com/nguyentrannhan/mezon-active-windows
- Homepage: https://ncc.asia
- Issues: https://github.com/nguyentrannhan/mezon-active-windows/issues
- npm.io page: https://npm.io/package/mezon-active-windows

## Dependencies (1)

- [node-addon-api](https://npm.io/package/node-addon-api.md) ^1.7.2

## Recent versions

- 0.1.39 (latest) — 2026-01-23
- 0.1.38 — 2025-01-11
- 0.1.37 — 2025-01-11
- 0.1.36 — 2025-01-11
- 0.1.35 — 2025-01-10
- 0.1.34 — 2025-01-10
- 0.1.33 — 2025-01-09
- 0.1.32 — 2025-01-08
- 0.1.31 — 2025-01-04
- 0.1.30 — 2025-01-02
- 0.1.29 — 2025-01-02
- 0.1.28 — 2025-01-01
- 0.1.27 — 2024-12-31
- 0.1.26 — 2024-12-31
- 0.1.25 — 2024-11-13
- … 11 more at https://npm.io/package/mezon-active-windows/versions

## README

# Mezon Active Window

Node C++ N-API module to get information on the currently selected window and the user idle time on Linux, MacOS and Windows.

> Currently only supports Windows and Linux / Xorg. 

Work in progress. Not on every platform all information are supported.

### Building / Installation

```bash
npm install
```

### Usage

```javascript
const activeWindows = require('active-windows');

console.log(activeWindows.getActiveWindow());
```

See `sample.js` for more information.

### Return-Value

```javascript
{
  // Operating system (linux | windows | macos)
  os: 'linux',
  // Process name (chromium.exe on windows)
  windowClass: 'chromium',
  // Blog | bytee.net
  windowName: 'Blog | bytee.net - Chromium',
  // Desktop on which the window is displayed (Linux only)
  windowDesktop: '2',
  // Window Type (Linux only)
  windowType: '340',
  // Process ID of the window
  windowPid: '34218',
  // Idle Time in seconds
  idleTime: '42',
}

{
  os: 'macos',
  windowClass: 'Visual Studio Code',
  windowName: '',
  windowDesktop: '0',
  windowType: '0',
  windowPid: '279',
  idleTime: '0'
}
```

# Build linux
```javascript
yarn config set nodedir ~/.cache/node-gyp/18.19.0
```

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