is-wayland
Check if the current Linux session is using Wayland
Last updated a year ago by sindresorhus .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ npm install is-wayland 
SYNC missed versions from official npm registry.

is-wayland

Check if the current Linux session is using Wayland

Install

npm install is-wayland

Usage

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 - Check if the process is running inside a Docker container
  • is-wsl - Check if the process is running inside Windows Subsystem for Linux

Current Tags

  • 0.1.0                                ...           latest (a year ago)

1 Versions

  • 0.1.0                                ...           a year ago
Maintainers (1)
Downloads
Total 2
Today 0
This Week 0
This Month 1
Last Day 0
Last Week 0
Last Month 1
Dependencies (0)
None
Dev Dependencies (1)
  • xo ^1.2.2
Dependents (1)

© 2010 - cnpmjs.org x YWFE | Home | YWFE