Hyprland & X11 Issue

I have installed Hyprland as a module with the Hyprland flake, in my system flake.

At the moment I have these settings in my configuration.nix:

xdg.portal.enable = true;
xdg.portal.config.common.default = “”;
xdg.portal.extraPortals = [ pkgs.xdg-desktop-portal-gtk ];

services.xserver.enable = true;
(plus xserver settings for keyboard layout & autologin)

I originally understood that Hyprland replaces X11, but this is not correct is it?

Hyprland cannot function without X11, can it?

Hyprland is a compositor that implements the Wayland display server protocol, which is a modern replacement of X11, so no, you cannot use X to run Hyprland. You can however use xwayland within Hyprland to run legacy X applications in Wayland with programs.hyprland.xwayland.enable which is true by default.

3 Likes

Thank you nrdxp. Yes, this is what I understood.
As per the Hyprland docs:

The NixOS module enables critical components needed to run Hyprland properly, such as: polkit, xdg-desktop-portal-hyprland, graphics drivers, fonts, dconf, xwayland, and adding a proper Desktop Entry to your Display Manager.

However if I mute the xserver, my system does not work.
(At start-up it freezes up, and I have to ALT + F2 to enter a new terminal, login, and get Hyprland going…)

Some display managers do not support Wayland sessions. Additionally, most display managers still use X to display graphics. This is one reason I chose GDM, because it can be configured to present using Wayland itself, and also supports launching Wayland sessions, leading to an completely X free desktop (with the exception of xwayland, when needed).

2 Likes

At risk of potentially confusing this discussion, Wayland compositors can run as Xorg clients.

This is more of a useful testing mechanism, or a niche window management feature than the intended use though (see e.g. gamescope for use cases).

I guess that the fact this is possible may be part of the confusion, given it’s very unintuitive if you’re used to the traditional X11 model.

1 Like