From 041af5f1de741b673c9e427f08c5cbabf4bc4021 Mon Sep 17 00:00:00 2001 From: Mihai Fufezan Date: Mon, 29 Aug 2022 19:32:20 +0300 Subject: [PATCH] Nix: add XWayland info --- pages/Nix/_index.md | 58 ++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 57 insertions(+), 1 deletion(-) diff --git a/pages/Nix/_index.md b/pages/Nix/_index.md index bcd2c6a..af7189a 100644 --- a/pages/Nix/_index.md +++ b/pages/Nix/_index.md @@ -1,9 +1,11 @@ ## Table of contents {{< toc format=html >}} -**NOTE:** Hyprland is NOT supported on NixOS stable. It may (not) compile or +{{< hint type=warning >}} +Hyprland is NOT supported on NixOS stable. It may (not) compile or work as intended. Please use the [flake](https://github.com/hyprwm/Hyprland/blob/main/flake.nix). +{{< /hint >}} ## Install and configure Hyprland on NixOS @@ -129,6 +131,60 @@ Check the [nix profile](https://nixos.org/manual/nix/stable/command-ref/new-cli/nix3-profile.html) command documentation for other upgrade options. +## XWayland + +XWayland is enabled by default in the Nix package. You can disable it either +in the package itself, or through the Home Manager module. + +#### Package + +```nix +(inputs.hyprland.packages.${pkgs.default}.default.override { + enableXWayland = false; +}) +``` + +#### HM module + +```nix +wayland.windowManager.hyprland = { + enable = true; + xwayland.enable = false; +} +``` + +### HiDPI + +By default, the Nix package includes a patched wlroots that can render HiDPI +XWayland windows. + +In order to enable the functionality, you have to add: + +```toml +exec-once=xprop -root -f _XWAYLAND_GLOBAL_OUTPUT_SCALE 32c -set _XWAYLAND_GLOBAL_OUTPUT_SCALE 2 +``` + +This will make XWL programs look as if they were unscaled. To fix this, you +have to export different environment variables to make the specific toolkits +render at the proper scaling. For example + +```sh +export GDK_SCALE=2 +export XCURSOR_SIZE=32 +``` + +{{< hint >}} +The GDK_SCALE variable won't conflict with wayland-native GTK programs. +{{< /hint >}} + +Usually, there's no reason to disable this functionality, as it won't affect +people who don't have HiDPI screens. + +If you *do* insist on disabling it though (e.g. for adding your own patches +to wlroots), you can do so by either using the `hyprland-no-hidpi` package, +or by passing the `hidpiXWayland = false;` flag, the same way as +[disabling XWayland](#package) + ## Cachix A [Hyprland Cachix](https://app.cachix.org/cache/hyprland) exists to cache the