How to Check if You are Using Wayland or Xorg?

Here is a quick tip to show you how to know if you are using Wayland or X display server on your Linux system.
Warp Terminal

There is a technical transition taking place in the desktop Linux world.

Most mainstream distros have started to move to the Wayland display server by default.

But not all legacy components are compatible with the newer Wayland. They work only with the good old X or Xorg display server.

So, when you are having trouble with your Linux system, it would be wise to check if the problem is coming because of the display server.

Let me show you how to check which display server you are using.

Check whether Wayland or Xorg is in use

The simplest and perhaps the most reliable way is to use the following command in a terminal:

echo $XDG_SESSION_TYPE

If you are using Wayland, you should get ‘wayland’ in the output:

abhishek@itsfoss:~$ echo $XDG_SESSION_TYPE 
wayland
waylnd

If you use xorg (X display server), you should get x11 in the output.

abhishek@itsfoss:~$ echo $XDG_SESSION_TYPE 
x11
x 11

To summarize:

  • Check the value of $XDG_SESSION_TYPE variable in terminal
  • For Wayland, you get wayland and for Xorg you get in the output.

A ridiculous but fun way to know if you are using Wayland on GNOME

I found it on Fedora Subreddit. If you are using GNOME, press Alt+F2, type r in the dialogue box and press enter. Normally it restarts the GNOME shell. But it won’t work in Wayland. It will display ‘restart is not available on Wayland’.

wayland in gnome
wayland in gnome

To Wayland or not?

GNOME has put so much emphasis on Wayland to provide a modern desktop experience. Ubuntu, Fedora and many other distros have switched to Wayland by default but many applications are lagging behind in Wayland support.

Many screen recorders and screenshot software don’t work with Wayland. Switching back to Xorg is the only option at times. Thankfully, it is quite easy to switch between Xorg and Wayland. Just log out and click the user profile and then click the gear symbol at the bottom to choose the session you want.

How to Switch Between Xorg and Wayland in Ubuntu
Brief: This quick tutorial shows you how to switch between xorg and Wayland display servers on Ubuntu and hopefully other Linux distributions. I hope you know what a display server is. It is the underlying technology thanks to which, you can use your computer graphically. Xorg (or X displa…

Personally, I suggest sticking with what your distribution provides. Only switch to the other when it is required.

About the author
Abhishek Prakash

Abhishek Prakash

Created It's FOSS 11 years ago to share my Linux adventures. Have a Master's degree in Engineering and years of IT industry experience. Huge fan of Agatha Christie detective mysteries 🕵️‍♂️

Become a Better Linux User

With the FOSS Weekly Newsletter, you learn useful Linux tips, discover applications, explore new distros and stay updated with the latest from Linux world

itsfoss happy penguin

Great! You’ve successfully signed up.

Welcome back! You've successfully signed in.

You've successfully subscribed to It's FOSS.

Success! Check your email for magic link to sign-in.

Success! Your billing info has been updated.

Your billing was not updated.