From f652d2388fa13c10f22e28b6dd32a83e96ba5685 Mon Sep 17 00:00:00 2001 From: larstvei Date: Sat, 21 Feb 2026 23:42:35 +0100 Subject: [PATCH] Use uwsm for running hyprland --- modules/desktop/default.nix | 6 +++++- modules/desktop/hypr/bindings/default.nix | 2 +- modules/desktop/hypr/default.nix | 20 +++++++++++++------- modules/nixos/graphical/default.nix | 12 ++++++++++-- 4 files changed, 29 insertions(+), 11 deletions(-) diff --git a/modules/desktop/default.nix b/modules/desktop/default.nix index 477fd6e..c1a7d82 100644 --- a/modules/desktop/default.nix +++ b/modules/desktop/default.nix @@ -47,6 +47,10 @@ services.darkman = { enable = true; - settings.portal = true; + settings = { + portal = true; + lat = 59.9; + lng = 10.7; + }; }; } diff --git a/modules/desktop/hypr/bindings/default.nix b/modules/desktop/hypr/bindings/default.nix index 94c65c2..50bf8dd 100644 --- a/modules/desktop/hypr/bindings/default.nix +++ b/modules/desktop/hypr/bindings/default.nix @@ -61,7 +61,7 @@ in "$mod, code:28, exec, kitty" # T (code:28) "$mod, code:26, exec, emacs" # E (code:26) "$mod, code:56, exec, zen-beta" # B (code:56) - "$mod, code:40, exec, darkman toggle" # D (code:40) + "$mod, code:40, exec, ${pkgs.darkman}/bin/darkman toggle" # D (code:40) "$mod, code:65, exec, ${nanostatus}/bin/nanostatus-toggle" # Space (code:65) "$mod SHIFT, code:58, exec, ${toggle-mirror-display}/bin/toggle-mirror-display" # M (code:58) + Shift diff --git a/modules/desktop/hypr/default.nix b/modules/desktop/hypr/default.nix index 941e6ab..23b3d5c 100644 --- a/modules/desktop/hypr/default.nix +++ b/modules/desktop/hypr/default.nix @@ -1,3 +1,4 @@ +{ pkgs, ... }: let theme = import ../theme; in @@ -15,7 +16,10 @@ in settings = { - exec-once = [ "swaylock || hyprctl dispatch exit" ]; + exec-once = [ + "uwsm finalize" + "swaylock || hyprctl dispatch exit" + ]; misc.disable_hyprland_logo = true; @@ -61,14 +65,16 @@ in services.darkman = { lightModeScripts.hyprland-light = '' - hyprctl keyword misc:background_color 0x${theme.bg.light} - hyprctl keyword general:col.active_border 0xFF${theme.primary.light} - hyprctl keyword general:col.inactive_border 0xFF${theme.secondary.light} + while read -r line; do export "$line"; done < <(${pkgs.systemd}/bin/systemctl --user show-environment) + ${pkgs.hyprland}/bin/hyprctl keyword misc:background_color 0x${theme.bg.light} + ${pkgs.hyprland}/bin/hyprctl keyword general:col.active_border 0xFF${theme.primary.light} + ${pkgs.hyprland}/bin/hyprctl keyword general:col.inactive_border 0xFF${theme.secondary.light} ''; darkModeScripts.hyprland-dark = '' - hyprctl keyword misc:background_color 0x${theme.bg.dark} - hyprctl keyword general:col.active_border 0xFF${theme.primary.dark} - hyprctl keyword general:col.inactive_border 0xFF${theme.secondary.dark} + while read -r line; do export "$line"; done < <(${pkgs.systemd}/bin/systemctl --user show-environment) + ${pkgs.hyprland}/bin/hyprctl keyword misc:background_color 0x${theme.bg.dark} + ${pkgs.hyprland}/bin/hyprctl keyword general:col.active_border 0xFF${theme.primary.dark} + ${pkgs.hyprland}/bin/hyprctl keyword general:col.inactive_border 0xFF${theme.secondary.dark} ''; }; } diff --git a/modules/nixos/graphical/default.nix b/modules/nixos/graphical/default.nix index dd3be2b..e55ae99 100644 --- a/modules/nixos/graphical/default.nix +++ b/modules/nixos/graphical/default.nix @@ -4,7 +4,7 @@ enable = true; settings = rec { initial_session = { - command = "hyprland > /dev/null 2>&1"; + command = "${pkgs.uwsm}/bin/uwsm start hyprland-uwsm.desktop"; user = "larstvei"; }; default_session = initial_session; @@ -23,7 +23,15 @@ extraPortals = [ pkgs.xdg-desktop-portal-hyprland pkgs.xdg-desktop-portal-gtk + pkgs.darkman ]; - config.hyprland."org.freedesktop.impl.portal.Settings" = "darkman"; + + config.hyprland = { + default = [ + "hyprland" + "gtk" + ]; + "org.freedesktop.impl.portal.Settings" = [ "darkman" ]; + }; }; }