Linux check x11 or wayland

How to Check If Wayland or Xorg Is Being Used

For some time now the Linux display server has been going through a transition for the graphical environment. The well established X Window System (a.k.a. X, X11 or X.Org) has been the default, but slowly the mainstream Linux desktop distributions have changed the default to Wayland. Unfortunately not all legacy components or applications are compatible even with the use of the compatibility layer of XWayland. As a result it can be beneficial to know for certain which display manager is being used in order to debug issues. I will show how this can be accomplished using a variety of methods that will work in most circumstances.

What is a Display Server?

A program that is responsible for handling the coordination of input and output of the hardware, the operating system and as well as each other. All the coordination is sent using a communication protocol, such as Wayland or X11. Without a display server a computer could not be used graphically.

Environment

Instructions were tested using the following.

  • Arch Linux
  • Fish v3.6.1
  • GNU Bash v5.1.16
  • GNOME v44.3
  • KDE Plasma v5.27.4

GNOME Settings

Screenshot of the about section within GNOME Settings that illustrates the location of Windowing System type just below GNOME version.

  1. Open GNOME Settings.
  2. Click on “About” on the left-hand side.
  3. On the right-hand side look for the value under “Windowing System”.

KDE Plasma

Screenshot of the about this system within System Settings that illutrates the location of the Graphics Platform type below kernel version.

  1. Open System Settings.
  2. Click on “About” on the left-hand side.
  3. On the right-hand side look for the value under “Graphics Platform”.

Environment Variable

During the loading process environment variables are set and as a result we can confirm which display server is being used by getting the value of the variable using a terminal. For best results look at using “XDG_SESSION_TYPE” or “env” examples.

    Display the value of the variable “XDG_SESSION_TYPE”.

Источник

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.

Читайте также:  Sshfs linux подключение с паролем

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

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 '') -p Type

If you are running the Xorg display server, you will get the following output.

For Wayland, the following output will be printed on your screen.

And finally, if you are connecting remotely using an SSH client, you will get.

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.

Источник

Как узнать Wayland или Xorg

Многие популярные дистрибутивы Linux уже используют Wayland по умолчанию. Так Ubuntu перешла на Wayland по умолчанию начиная с 22.04, Fedora использует Wayland уже давно. Недавно к списку этих дистрибутивов присоединилась ещё и SUSE и Debian. Однако у Wayland всё ещё есть проблемы. Многие старые программы не поддерживаются или работают плохо.

Если у вас возникли какие-либо проблемы при работе с старыми программами, нужно проверить какой дисплейный сервер вы используете. Есть несколько способов сделать это. В этой статье мы рассмотрим как узнать Wayland или Xorg в терминале.

Как посмотреть Wayland или Xorg

Самый простой способ посмотреть какой дисплейный сервер используется в данный момент, это вывести содержимое переменной окружения XDG_SESSION_TYPE. Если сейчас используется Wayland, то будет выведено wayland, а при использовании Xorg — X11:

Читайте также:  Linux no dns resolution

Кроме того, вы можете узнать тип текущей сессии с помощью loginctl. Посмотрите список сессий запустив утилиту с командой list-sessions или без параметров:

Для того чтобы вывести тип конкретной сессии передайте её идентификатор в команду show-session. Например, если номер сессии 3:

loginctl show-session 3 -p Type

Или можно сделать всё одной командой, получив идентификатор сессии из переменной окружения XDG_SESSION_ID:

loginctl show-session «$XDG_SESSION_ID» -p Type

В Ubuntu эту информацию можно посмотреть и в графическом интерфейсе. Откройте Настройки, перейдите в раздел О системе и найдите пункт Оконный интерфейс. Здесь будет отображено название дисплейного сервера:

Как посмотреть какие приложения используют XWayland

Для того чтобы старые приложения X11 могли работать в Wayland окружении существует прослойка совместимости XWayland. Если вы используете Wayland, то возможно, у вас возникнет необходимость узнать какие приложения используют эту прослойку. Для этого можно использовать команду xlsclients. Она отображает все программы, которые используют Xwayland в данный момент:

Например, в данном случае, запущен xterm. Есть ещё один способ быстро посмотреть какие из запущенных окон используют XWayland. Просто запустите программу Xeyes. После этого появится окно с глазами, которые должны сделить за курсором и смотреть всегда в его сторону. Но поскольку утилита использует X сервер, то и следить она сможет только за курсором в Xorg приложениях. Таким образом, если глаза двигаются когда вы водите курсором мыши в зоне окна — значит оно использует Xwayland, если нет — то Wayland:

Выводы

В этой небольшой статье мы рассмотрели как узнать Wayland или Xorg используется в вашей системе, а также как посмотреть какие приложения всё ещё работают через Xorg когда используется Wayland.

Обнаружили ошибку в тексте? Сообщите мне об этом. Выделите текст с ошибкой и нажмите Ctrl+Enter.

Источник

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.

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

[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.
Читайте также:  Matrix in linux terminal

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

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.

Источник

How to know whether Wayland or X11 is being used

Login Screen

I just installed the latest Kali Linux on my laptop which was based on Debian 7 (oldstable). I then dist-upgrad-ed the whole thing to Debian 8. I’ve always wanted Wayland instead of X11, so I installed the necessary packages. Then created a minimal ~./config/weston.ini configuration. Now, from the Gnome login screen: I can boot to Gnome on Wayland or LXDE (among others). The previous with very limited success and the latter (LXDE) almost perfectly, though the panel needs setting up (I have to look up freedesktop). Anyways, in LXDE, the GUI is more responsive than it was on the oldstable and possibly as fast when it was running Windows 7. I was pleased. But I want to know if this is because of all the library/module upgrades from Debian 7 to 8 or from using Wayland (if I really am using Wayland at all). I skimmed through htop and found a /usr/bin/Xorg running and no process named «wayland». So which one am I currently running?

run xprop, this tool will work on xapplications running under emulation but not wayland or gnome-shell on wayland.

I guess I’m the only one to notice that while the OP said he was operating on debian, the screenshot he presented is clearly fedora.

Classical SE: An incorrect/incomplete, complicated answer gets 294 upvotes, and the simpler, correct, and complete one gets only 2. Getting the best answer at the top sure is a hard problem to solve.

Источник

Оцените статью
Adblock
detector