Home Linux Commandline Tips How to Check What Display Server in Use: Wayland or Xorg?

How to Check What Display Server in Use: Wayland or Xorg?

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.

Check Wayland Display Server in Linux
Check Wayland Display Server in Linux

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
Check Linux Display Server
Check Linux Display Server

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.

Winnie Ondara
My name is Winnie, a Linux enthusiast and passionate tech writer in Linux and DevOPs topics. I enjoy keeping abreast with the latest technologies in the Linux ecosystem and trying out new tools provided by the FOSS community.

Each tutorial at UbuntuMint is created by a team of experienced writers so that it meets our high-quality standards.

Was this article helpful? Please add a comment to show your appreciation and support.

Got something to say? Join the discussion.

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published or shared. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.