How to Switch Between Wayland and Xorg Sessions on Arch Linux

How to Switch Between Wayland and Xorg Sessions on Arch Linux

Arch Linux is known for its simplicity, flexibility, and rolling-release nature. Among the many customizable aspects of Arch is the ability to choose between different display servers—Wayland and Xorg (X11)—for graphical sessions. Both have their merits and ideal use cases. In this guide, we’ll explore how to switch between Wayland and Xorg sessions on Arch Linux, the pros and cons of each, and how to configure your system to use the one that fits your needs.


What Are Wayland and Xorg?

Before diving into how to switch between them, let’s take a moment to understand what Wayland and Xorg are.

Xorg (X11)

Xorg is the most widely used implementation of the X Window System, which has been the standard for UNIX-like systems since the 1980s. It manages graphical input and output for Linux desktops and allows multiple applications to share screen space.

Pros

  • Mature and well-supported.
  • Wide compatibility with applications and legacy software.
  • Extensive configuration options.

Cons

  • Performance overhead due to its design (e.g., the need for a compositor).
  • Potential security issues due to its openness to all input/output streams.

Wayland

Wayland is a modern display protocol intended to replace Xorg. It aims to provide a simpler and more secure architecture by handing over many responsibilities to the compositor.

Pros

  • Better security and isolation between apps.
  • Lower latency and better performance for some workloads.
  • Modern architecture that reduces the need for external compositors.

Cons

  • Not all desktop environments and applications are fully compatible.
  • Limited support for screen sharing and remote desktop in some setups.

Desktop Environments and Display Server Support

Before you try switching, it’s important to check whether your desktop environment (DE) supports both Wayland and Xorg.

Desktop EnvironmentWayland SupportXorg Support
GNOME✅ Yes (Default)✅ Yes
KDE Plasma✅ Yes (Optional)✅ Yes (Default)
Sway✅ Wayland-only❌ No
Xfce, LXQt, etc.❌ No✅ Yes

Note: You need to install a DE that supports both protocols to be able to easily switch between them. GNOME and KDE Plasma are the most flexible in this regard.


Step-by-Step: Switching Between Wayland and Xorg

Here’s how you can switch between Wayland and Xorg sessions on Arch Linux.

Step 1: Install a Compatible Desktop Environment

Let’s assume you’re using either GNOME or KDE Plasma, both of which support Wayland and Xorg.

For GNOME

sudo pacman -S gnome gdm

For KDE Plasma

sudo pacman -S plasma kde-applications sddm

Enable the appropriate display manager:

# For GNOME
sudo systemctl enable gdm.service --now

# For KDE
sudo systemctl enable sddm.service --now

Step 2: Understand Your Display Manager

The display manager (DM) is responsible for starting your graphical session. Popular DMs like GDM (GNOME Display Manager) and SDDM (Simple Desktop Display Manager) support choosing between sessions like “GNOME on Xorg” or “Plasma (Wayland).”

  • GDM detects whether a Wayland session is available and will default to it.
  • SDDM provides a session switcher in its GUI login screen.

Step 3: Select the Session Type at Login

Once your display manager is running and a compatible DE is installed:

  1. Reboot your system:

    sudo reboot
    
  2. On the login screen:

    • Click on the gear icon (⚙️) or session selector next to your username.
    • Choose:
      • GNOME (Wayland)
      • GNOME on Xorg
      • Plasma (Wayland)
      • Plasma (X11)
  3. Enter your password and log in.

The choice you make here determines whether your session will use Wayland or Xorg.


Step 4: Verifying the Session Type

Once logged in, you can verify whether you’re running Wayland or Xorg.

Option 1: Check the $XDG_SESSION_TYPE environment variable

echo $XDG_SESSION_TYPE
  • Will return wayland or x11.

Option 2: Use loginctl

loginctl show-session $(loginctl | grep $(whoami) | awk '{print $1}') -p Type

Option 3: Look at the process tree

ps -e | grep -E 'Xorg|wayland'

Advanced: Forcing a Session Type Manually

Sometimes, you may want to force your system to use a particular session type, especially when scripting or troubleshooting.

GDM: Disable Wayland

To force Xorg in GDM:

sudo nano /etc/gdm/custom.conf

Uncomment and set:

WaylandEnable=false

To force Wayland, ensure that line is either commented or set to true.

Restart GDM to apply:

sudo systemctl restart gdm

SDDM: Set Default Session

Edit the SDDM configuration:

sudo nano /etc/sddm.conf

Or create the config file if it doesn’t exist:

sudo mkdir -p /etc/sddm.conf.d
sudo nano /etc/sddm.conf.d/session.conf

Add the following:

[General]
Session=plasma.desktop  # For Xorg

# or
Session=plasmawayland.desktop  # For Wayland

Restart SDDM:

sudo systemctl restart sddm

Troubleshooting Tips

Applications Look Broken in Wayland

Some apps may not work well under Wayland (e.g., screen recorders, legacy software). Try launching them with:

GDK_BACKEND=x11 application_name

Or switch back to an Xorg session for better compatibility.

No Option to Choose Session

If you’re not seeing the option to pick Wayland/Xorg:

  • Ensure all session files are present in /usr/share/wayland-sessions/ and /usr/share/xsessions/.
  • Reinstall your desktop environment packages.

Remote Desktop Doesn’t Work

Wayland limits remote desktop support for security. Use Xorg if remote access is a priority.


When to Use Wayland vs. Xorg

Use CaseRecommended Display Server
General desktop use✅ Wayland (if supported)
Gaming (with Wayland support)✅ Wayland (via wlroots)
Legacy apps or screen recording✅ Xorg
Remote desktop or VNC✅ Xorg
Touchscreen and HiDPI devices✅ Wayland (better scaling)

Conclusion

Switching between Wayland and Xorg sessions on Arch Linux is relatively straightforward, especially if you’re using a modern display manager like GDM or SDDM. The ability to choose the most suitable display protocol allows users to tailor their environment for performance, compatibility, or modern features.

While Wayland is undoubtedly the future of Linux graphics with better security and performance, Xorg remains a solid choice for compatibility and flexibility—especially when dealing with legacy applications or remote access tools.

As Wayland matures, you’ll likely find yourself defaulting to it for daily use. Until then, Arch gives you the power to switch freely between both worlds.