Check If You Are Using X11 or Wayland

If you are using Linux but are not sure which display server you are using (X11; Wayland), you can check your environment variables.

I don't think these variables are mutually exclusive. And it is worth checking for both.

If the WAYLAND_DISPLAY environment variable is present then the system is using Wayland.

I don't believe it is relevant what the values are. We're only interested if the variables are there or not.

In this example, DISPLAY is present. So, I am using X11.

Get-ChildItem Env: | Where-Object { $_.Name -match "(DISPLAY|WAYLAND_DISPLAY)" }

Name                           Value
----                           -----
DISPLAY                        :0.0

You will find other advice online relating to loginctl or $XDG_SESSION_TYPE. But there are problems with those answers. And checking the environment variables above avoids those problems.

References

=> How I can find out if a Linux system uses Wayland or X11? | Stack Overflow | Windowing system | Wikipedia | about Environment Variables | Microsoft Docs

Created: Wednesday, April 27, 2022

Updated: Wednesday, April 27, 2022

Proxy Information
Original URL
gemini://pwshnotes.flounder.online/gemlog/2022-04-27-x11-wayland.gmi
Status Code
Success (20)
Meta
text/gemini; charset=utf-8
Capsule Response Time
707.369722 milliseconds
Gemini-to-HTML Time
0.500219 milliseconds

This content has been proxied by September (ba2dc).