Xorg and Wayland are the main display servers in Linux. Xorg, (X Display Server) is the legacy display server that has been around for quite a while in most Linux systems. It’s the most widely adopted display server and a prerequisite for most GUI applications.
Wayland, on the other hand, is the newer display server that is intended to be a replacement for the Xorg Server. In fact, Wayland is included by default in Ubuntu 21.04. However, Ubuntu reverted to Xorg due to lots of negative feedback. Currently, Xorg remains the default and most popular display server in most systems.
In this article, we seek to find out how you can check if you are using Wayland or Xorg on your Linux system.
1. Checking Wayland or Xorg Display Server in Linux
The most straightforward way of checking the display server you are currently running is to query the XDG_SESSION_TYPE environment variable by running the echo command as shown.
$ echo $XDG_SESSION_TYPE wayland
If you are running Wayland, you will get ‘wayland‘ as the output.
If Xorg is your display server, you will get ‘x11‘ as the output.
$ echo $XDG_SESSION_TYPE x11
If you are connected to a remote system or server via an SSH client such as PuTTY or MobaXterm, you will get ‘tty‘ printed on the screen.
$ echo $XDG_SESSION_TYPE tty
2. Checking Wayland or Xorg Display Server Using loginctl Command
The loginctl is a system management utility that forms part of the systemd toolkit. It performs various tasks including viewing logged-in users, managing user sessions, and locking and unlocking the screen to mention a few.
The command can also show the display server you are using a combination of other command-line arguments as shown.
$ loginctl show-session $(loginctl | grep $(whoami) | awk '{print $1}') -p Type
If you are running the Xorg display server, you will get the following output.
Type=x11
For Wayland, the following output will be printed on your screen.
Type=wayland
And finally, if you are connecting remotely using an SSH client, you will get.
Type=tty
We hope we have given you enough insights on how you can go about checking the display server that you are using. That’s it for now.