TranslateProject/sources/tech/20221020.0 ⭐️ How to Check: Xorg or Wayland Display Server.md

3.2 KiB
Raw Blame History

How to Check: Xorg or Wayland Display Server?

Heres how you can quickly check whether you are running Xorg or Wayland Display Server.

With every passing day, the modern Wayland display server is making its way to all Linux distributions. Although the legacy Xorg is still relevant and will stay, Wayland is undoubtedly better in security and other performance aspects.

However, Xorg will not completely phase out anytime soon. Probably never.

If you are running any Linux distribution, how can you check whether you are running Xorg or Wayland? Heres how.

Wayland or Xorg: Which one are you running?

  • Open a terminal window (CTRL+ALT+T) in your Linux distributions (e.g. Ubuntu, Fedora, Arch…etc.).

  • Then type the following command and hit enter.

echo $XDG_SESSION_TYPE
  • The output of the command will tell you whether the current session is Wayland or Xorg (X11).
[debugpoint@fedora ~]$ echo $XDG_SESSION_TYPEwayland

This command can give you details about Xorg or Wayland

Thats simple. However, there are other ways as well.

Other methods

Using Settings

If you want a graphical method, open your Linux distribution settings application. In the about section, you should see the Wayland/X11 mentioned under some label.

For example, in the GNOME Settings, you can find it under “Windowing system”, as shown below.

In GNOME Settings you can find it

Using session values

You can also find it out using loginctl which is the systemd login manager. Remember, it only works for systemd-based systems.

Open a terminal and run the below command. You can see the session id value. In this example c2.

loginctl

Now, pass the session id to the following command to get the display server type. Make sure to change c2 to your system spec.

loginctl show-session c2 -p Type

Using loginctl to find out

Wrapping Up

So, these are some of the ways you can find out whether you are running Systemd or Xorg in your Linux system. You can also use the above commands in your shell scripts for further process automation.

Cheers.


via: https://www.debugpoint.com/check-wayland-or-xorg/

作者:Arindam 选题:lkxed 译者:译者ID 校对:校对者ID

本文由 LCTT 原创编译,Linux中国 荣誉推出