From 9eef98a9629fb887a186fa317a2a30e424768d8d Mon Sep 17 00:00:00 2001 From: Yan Lin Date: Tue, 4 Nov 2025 12:59:02 +0100 Subject: [PATCH] fix screen management --- modules/hyprland/home.nix | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/modules/hyprland/home.nix b/modules/hyprland/home.nix index 2b5bf6c..b066897 100644 --- a/modules/hyprland/home.nix +++ b/modules/hyprland/home.nix @@ -83,9 +83,13 @@ enable = true; xwayland.enable = true; + # Source nwg-displays generated monitor configuration + extraConfig = '' + source = ~/.config/hypr/monitors.conf + ''; + settings = { - # Monitor configuration - monitor = ",preferred,auto,1"; + # Monitor configuration handled by nwg-displays (see extraConfig above) # Environment variables for input methods and theming env = [ @@ -221,12 +225,6 @@ "SUPER CTRL, k, movewindow, u" "SUPER CTRL, l, movewindow, r" - # Move window to adjacent monitor (vim-style) - "SUPER ALT, h, movewindow, mon:l" - "SUPER ALT, j, movewindow, mon:d" - "SUPER ALT, k, movewindow, mon:u" - "SUPER ALT, l, movewindow, mon:r" - # Workspace navigation (1-9) "SUPER, 1, workspace, 1" "SUPER, 2, workspace, 2" @@ -270,6 +268,12 @@ "SUPER, mouse:272, movewindow" "SUPER, mouse:273, resizewindow" ]; + + # Lid switch bindings - disable internal display when lid closes, reload config when lid opens + bindl = [ + ", switch:on:Lid Switch, exec, hyprctl keyword monitor \"eDP-1, disable\"" + ", switch:off:Lid Switch, exec, hyprctl reload" + ]; }; };