Arch

How To install Wayland on Arch Linux

In Linux operating system to establish the communication between the graphics hardware and display screen a particular communication protocol is used. In the past till 2016, the X11 communication protocol was used in Arch and other Linux distributions, however after that period a new and improved protocol was introduced named Wayland. It is comparatively lighter, is more secure, and is compatible with modern or new display technologies.

Outline:

How to Install Wayland on Arch Linux

On Arch Linux Wayland is already pre-installed, however, some Linux distributions may have Wayland missing as most of Linux operating system by default have their windowed system to X11. To verify if Wayland is pre-installed on Arch use the Q and i flag:

pacman -Qi wayland

If Wayland is not installed on your Arch Linux, then use the Pacman package installer to install Wayland:

sudo pacman -S --needed wayland

Once the installation is complete, there are some packages that are required to be installed on Arch Linux which include:

  • Xorg-xwayland: This package runs xclients on Wayland.
  • Xorg-xlsclients: This is an optional package that only lists the client applications that are running on the system display.
  • Qt5-wayland: This package is responsible for Qt APIs on Wayland.
  • Glfw-wayland: This package is responsible for GUI app development packages for Wayland.

Now to install all of these Wayland packages execute:

sudo pacman -S --needed xorg-xwayland xorg-xlsclients qt5-wayland glfw-wayland

How to Enable Wayland on Arch Linux

If you are using gdm display manager then to enable Wayland on Arch simply open its custom configuration file and replace waylandEnable=false to waylandEnable=true:

sudo nano /etc/gdm/custom.conf

However, using the GDM display manager on Arch for Wayland on GNOME can cause screen flickering issues. So to avoid that issue you have to install any other display manager, here I have installed SDDM display manager:

sudo pacman -S sddm

Once this display manager is installed then disable the previous one to avoid any conflicts:

sudo systemctl disable gdm

Now enable sddm on Arch:

sudo systemctl enable sddm

After enabling sddm now start it and as a result, you will see a login window from there reboot the system to apply the changes:

sudo systemctl start sddm

Wayland on GNOME Desktop on Arch Linux

For Linux distributions, there are a number of different desktop environments that can be installed. Two of the popular ones for Arch Linux and other Linux distributions are GNOME and KDE Plasma. So for GNOME go to the switch user page and from there under the session’s menu select GNOME on Wayland:

After logging in to your Arch user account, you can verify the Wayland as a windowing system in Arch system details:

Alternatively, you can verify by command line as well by printing the value of XDG_SESSION_TYPE variable in which the system display server name is saved:

echo $XDG_SESSION_TYPE

Wayland on KDE Plasma Desktop

To run Wayland on KDE you need to first install it on Arch and for that use the Pacman package installer on Arch. Along with that also install the necessary KDE applications which will make it fully functional:

sudo pacman -S --needed plasma kde-applications

During installation, you will come across various prompts the first one will be about installing 51 members in group plasma so to allow it simply enter. The next prompt will be about KDE-applications and for that again hit enter:

The next prompt is about the selection of a framework that uses the API for audio and video playback in KDE applications. Here are the two options:

  • phonon-qt5-gstreamer: It is a framework that uses gstreamer for creating multimedia applications that support a wide range of media streams. To support more formats, you might need to install an additional codec package.
  • phonon-qt5-vlc: This backend is more reliable as it uses a VLC media player, which is capable of handling almost every media file.

Here I have opted for VLC as it is far better when it comes to quality and stability.

The next prompt is about installing qt5-bindings, which is a cross-platform application development network. This provides C++ API and supports other languages which include Python, Rust, and others. Here I have selected python-pyqt5 because it is more stable and mature than pyside2. It has a large user base and more third-party libraries.

After that, there is another prompt that provides two options for installing cron which is a time-based job scheduler. Here I have installed it by core repository as it provides a standard cron daemon and anacron tool for running the tasks that are not time-sensitive.

Next, the prompt is about installing tessdata which serves the purpose of recognizing the text from different languages and scripts using tesseract. It provides the OCR functionality for its applications such as okular and spectacle:

Once the KDE is successfully installed on Arch install the plasma Wayland session package which provides the necessary components for running KDE plasma on Wayland. Here, the needed flag ensures the installation of only the missing dependencies:

sudo pacman -S --needed plasma-wayland-session

After installing all the missing dependencies, perform a system reboot so that the applied changes are enforced:

sudo reboot

On system reboot when the login page appears, select Plasma (Wayland) from the session window and then login to your user account:

Once you are logged in, you can verify the Wayland by navigating to About section in System Settings:

Now if you want to shift back to X11 then from the session menu select Plasma (X11) or GNOME on Xorg. Further, if you want to use any other display manager then in that case you need to disable it first before installing any other:

sudo systemctl disable sddm

Conclusion

Wayland is a modern and efficient display protocol for Linux which offers several advantages over Xorg such as improved stability, improved graphical performance and security. On Arch Linux it is preinstalled but you need to either enable it or shift the session depending on the display manager you are using. To verify if it is preinstalled on Arch use the query flag along with Pacman. If you are running Arch as a virtual machine then use the sddm display manager because with GNOME you will face screen blackout and flickering issues.

Similar Posts