# is-wayland

> Check if the current Linux session is using Wayland

Latest version **0.1.0** (published 2025-09-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install is-wayland
pnpm add is-wayland
yarn add is-wayland
bun add is-wayland
```

## Health

**Score 60/100 (C)** — status: stable.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2025-09-23 |
| First published | 2025-09-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >=20 |
| Dependencies | 0 |
| Unpacked size | 3.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 21 |
| Author | Sindre Sorhus |
| Maintainers | sindresorhus |
| Keywords | wayland, linux, display, server, x11, xorg, session, desktop, environment, detect, check, is |

## Links

- npm: https://www.npmjs.com/package/is-wayland
- Repository: https://github.com/sindresorhus/is-wayland
- Homepage: https://github.com/sindresorhus/is-wayland#readme
- Issues: https://github.com/sindresorhus/is-wayland/issues
- Funding: https://github.com/sponsors/sindresorhus
- npm.io page: https://npm.io/package/is-wayland

## Alternatives

- [memory-cache](https://npm.io/package/memory-cache.md) — 795.0K weekly downloads
- [@httptoolkit/proxy-agent](https://npm.io/package/@httptoolkit/proxy-agent.md) — 11.2K weekly downloads
- [express-cache-controller](https://npm.io/package/express-cache-controller.md) — 5.3K weekly downloads
- [http-cache-middleware](https://npm.io/package/http-cache-middleware.md) — 4.5K weekly downloads
- [cache2](https://npm.io/package/cache2.md) — 1.5K weekly downloads

## Recent versions

- 0.1.0 (latest) — 2025-09-23

## README

# is-wayland

> Check if the current Linux session is using Wayland

## Install

```sh
npm install is-wayland
```

## Usage

```js
import isWayland from 'is-wayland';

if (isWayland()) {
	console.log('Running in Wayland');
	// Use wl-clipboard tools
} else {
	console.log('Not running in Wayland');
	// Use X11 tools
}
```

## How it works

The package detects Wayland sessions by checking:

1. **`WAYLAND_DISPLAY` environment variable** - The primary indicator set by Wayland compositors
2. **`XDG_SESSION_TYPE` environment variable** - Set by display managers to indicate session type

Returns `false` on non-Linux platforms.

## Related

- [is-docker](https://github.com/sindresorhus/is-docker) - Check if the process is running inside a Docker container
- [is-wsl](https://github.com/sindresorhus/is-wsl) - Check if the process is running inside Windows Subsystem for Linux

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