From f5345af026a9207e0c9fe3422ef8b1d8de437766 Mon Sep 17 00:00:00 2001 From: Pedro Rey Anca Date: Fri, 11 Jul 2025 16:13:22 +0200 Subject: [PATCH] Use uwsm to set desktop variables, not hyprland --- modules/home/hyprland/variables.nix | 46 ++++++++++++++--------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/modules/home/hyprland/variables.nix b/modules/home/hyprland/variables.nix index 7d28466..bb68b39 100644 --- a/modules/home/hyprland/variables.nix +++ b/modules/home/hyprland/variables.nix @@ -1,31 +1,31 @@ -{ - lib, - config, - ... -}: { - home.sessionVariables = { - NIXOS_OZONE_WL = "1"; +{lib, ...}: let + variables = { + NIXOS_OZONE_WL = 1; ELECTRON_OZONE_PLATFORM_HINT = "auto"; - __GL_GSYNC_ALLOWED = "0"; - __GL_VRR_ALLOWED = "0"; - _JAVA_AWT_WM_NONEREPARENTING = "1"; - DISABLE_QT5_COMPAT = "0"; - GDK_BACKEND = "wayland"; - ANKI_WAYLAND = "1"; + __GL_GSYNC_ALLOWED = 0; + __GL_VRR_ALLOWED = 0; + _JAVA_AWT_WM_NONEREPARENTING = 1; + DISABLE_QT5_COMPAT = 0; + GDK_BACKEND = "wayland,x11,*"; + ANKI_WAYLAND = 1; DIRENV_LOG_FORMAT = ""; - WLR_DRM_NO_ATOMIC = "1"; - QT_AUTO_SCREEN_SCALE_FACTOR = "1"; - QT_WAYLAND_DISABLE_WINDOWDECORATION = "1"; - QT_QPA_PLATFORM = "wayland"; - MOZ_ENABLE_WAYLAND = "1"; - MOZ_USE_XINPUT2 = "1"; + WLR_DRM_NO_ATOMIC = 1; + QT_AUTO_SCREEN_SCALE_FACTOR = 1; + QT_WAYLAND_DISABLE_WINDOWDECORATION = 1; + QT_QPA_PLATFORM = "wayland;xcb"; + MOZ_ENABLE_WAYLAND = 1; + MOZ_USE_XINPUT2 = 1; WLR_BACKEND = "vulkan"; - WLR_NO_HARDWARE_CURSORS = "1"; - XDG_SESSION_TYPE = "wayland"; SDL_VIDEODRIVER = "wayland"; CLUTTER_BACKEND = "wayland"; }; +in { + home.sessionVariables = variables; - wayland.windowManager.hyprland.systemd.variables = ["--all"]; - wayland.windowManager.hyprland.settings.env = lib.attrsets.mapAttrsToList (name: value: "${name},${builtins.toString value}") config.home.sessionVariables; + xdg.configFile."uwsm/env".text = builtins.concatStringsSep "\n" ( + lib.attrsets.mapAttrsToList ( + name: value: "export ${name}=\"${builtins.toString value}\"" + ) + variables + ); }