diff --git a/.config/hypr/hyprland.lua b/.config/hypr/hyprland.lua index 260c722..f5313c2 100644 --- a/.config/hypr/hyprland.lua +++ b/.config/hypr/hyprland.lua @@ -91,15 +91,12 @@ hl.gesture({ fingers = 3, direction = "horizontal", action = "workspace" }) hl.gesture({ fingers = 3, direction = "up", action = "fullscreen" }) hl.gesture({ fingers = 3, direction = "down", action = "fullscreen", mode = "maximize" }) --- Import the completed session environment before launching long-lived helpers. +-- UWSM imports the session environment before Hyprland starts. hl.on("hyprland.start", function() local commands = { - "dbus-update-activation-environment --systemd --all", - "systemctl --user import-environment WAYLAND_DISPLAY DISPLAY XDG_CURRENT_DESKTOP XDG_SESSION_DESKTOP XDG_SESSION_TYPE WLR_DRM_DEVICES LIBVA_DRIVER_NAME __GLX_VENDOR_LIBRARY_NAME QT_QPA_PLATFORM QT_QPA_PLATFORMTHEME GDK_BACKEND MOZ_ENABLE_WAYLAND PATH XDG_DATA_DIRS XDG_CONFIG_DIRS DBUS_SESSION_BUS_ADDRESS", "systemctl --user start hyprpolkitagent", "otd-daemon", "lorri daemon", - "/etc/pam_init", "blueman-applet", "udev-block-notify", "echo us > /tmp/kb_layout", @@ -112,7 +109,6 @@ hl.on("hyprland.start", function() "easyeffects --gapplication-service", "voxtype daemon", "openrgb --startminimized", - "dms run", } for _, command in ipairs(commands) do hl.exec_cmd(command) end end) diff --git a/servers/ui-mode/configuration.nix b/servers/ui-mode/configuration.nix index 654c3f9..5fd194a 100644 --- a/servers/ui-mode/configuration.nix +++ b/servers/ui-mode/configuration.nix @@ -109,6 +109,7 @@ LC_TIME = "en_GB.UTF-8"; }; services.displayManager.sddm.enable = true; + services.displayManager.defaultSession = "hyprland-uwsm"; services.desktopManager.plasma6 = { enable = true; }; @@ -227,6 +228,7 @@ # package = unstable-pkgs.hyprland; }; + programs.uwsm.enable = true; xdg.portal = { enable = true; extraPortals = with pkgs; [ @@ -270,6 +272,29 @@ compositor.name = "hyprland"; # "niri" or "hyprland" or "sway" configHome = "/home/dan"; }; + # DMS otherwise falls back to whichever session desktop file finishes loading + # first. Seed its per-boot memory so the UWSM-managed session is deterministic. + systemd.tmpfiles.settings."20-dms-greeter-default-session" = { + "/var/lib/dms-greeter/.local".d = { + user = "greeter"; + group = "greeter"; + mode = "0750"; + }; + "/var/lib/dms-greeter/.local/state".d = { + user = "greeter"; + group = "greeter"; + mode = "0750"; + }; + "/var/lib/dms-greeter/.local/state/memory.json"."f+" = { + user = "greeter"; + group = "greeter"; + mode = "0640"; + argument = builtins.toJSON { + lastSessionDesktopId = "hyprland-uwsm"; + lastSuccessfulUser = "dan"; + }; + }; + }; security.pam.services = { greetd.kwallet = { enable = true; diff --git a/servers/ui-mode/home.nix b/servers/ui-mode/home.nix index 4f190a6..c3e8595 100644 --- a/servers/ui-mode/home.nix +++ b/servers/ui-mode/home.nix @@ -470,7 +470,7 @@ in # programs.dsearch.enable = true; programs.dank-material-shell = { enable = true; - systemd.enable = false; + systemd.enable = true; # niri = { # enableKeybinds = false; # Sets static preset keybinds # # enableSpawn = true; # Auto-start DMS with niri, if enabled