Socket
Book a DemoInstallSign in
Socket

is-wayland

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

is-wayland

Check if the current Linux session is using Wayland

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
360K
33.77%
Maintainers
1
Weekly downloads
 
Created
Source

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:

  • WAYLAND_DISPLAY environment variable - The primary indicator set by Wayland compositors
  • XDG_SESSION_TYPE environment variable - Set by display managers to indicate session type

Returns false on non-Linux platforms.

  • 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

Keywords

wayland

FAQs

Package last updated on 23 Sep 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts