How to Check if You are Using Wayland or Xorg?

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:

[email protected]:~$ echo $XDG_SESSION_TYPE 
wayland
waylnd

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

[email protected]:~$ 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.

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

Similar Posts

  • I haven’t yet really seen anyone highlight how wayland is actually better than xorg is, or why you should have it on by default. When I upgraded to Ubuntu 22.04, a lot of stuff stopped working or looked weird (OBS, Discord, emulator windows…) and I was worried something had gone wrong with the upgrade. But then I found some random stack overflow question where the solution was to switch to xorg, and all these problems disappeared. If a big chunk of software doesn’t support wayland, why is it the default option on Ubuntu??

  • Wayland is beta software. I they brainwashed fanboys into thinking this piece of software was a complete release. It has people still advocating for it even though it has showstopper bugs. They want change simply because the alternative isn’t new, but non functional.

    Cue “Not Wayland’s Fault” and “It works on my box” posts.

  • gnome has wayland huh? Yet another reason I am tempted to go back despite enjoying KDE. It just seems so much more solid. Despite my love of tinkering and KDE delivering in spades. It just feels like if i wanted to tinker with gnome all I’d need to do is just install some extensions.

    • As far as I know is KDE also runnig on wayland. So there would no need for you to change because of that reason.
      As far I know actually the gnome, kde, elightment, sway (i3) and wayfire Desktops are running on wayland.
      XFCE, Cinamon, Mate and many ohter Desktops don’t run on wayland.

  • I am using XFCE4. So I don’t need to check. XFCE4 is only runnig on xorg, but not on wayland.
    There is a lot of talk about how much more secure Wayland should be. But for me is no way to change to gnome ( i hate gnome ).
    I staying with XFCE4 at xorg.

  • Thanks, vers useful.
    But why do I get nothing but a white line to my echo $XDG_SESSION_TYPE ?
    Bye the way I’m on Wayland, Ubuntu 22.04…
    Thanks in sdvance.