From 84f149fe88c0f8e35cc0e72aa60b5cfa06112faf Mon Sep 17 00:00:00 2001 From: Armel van Ravels Date: Fri, 26 Jun 2026 18:23:34 +0200 Subject: [PATCH] reconfigure monitors after config.reloaded event --- systems/modules/home/wm/hyprland.nix | 35 ++++++++++++++++++++-------- 1 file changed, 25 insertions(+), 10 deletions(-) diff --git a/systems/modules/home/wm/hyprland.nix b/systems/modules/home/wm/hyprland.nix index 569beba..d399303 100644 --- a/systems/modules/home/wm/hyprland.nix +++ b/systems/modules/home/wm/hyprland.nix @@ -180,19 +180,34 @@ in (bind "${mod} + mouse:272" dsp.window.drag { mouse = true; }) (bind "${mod} + mouse:273" dsp.window.resize { mouse = true; }) ]; + on = [ + (mkArgs [ + "hyprland.start" + (mkLuaInline '' + function() + hl.exec_cmd("waybar") - on = mkArgs [ - "hyprland.start" - (mkLuaInline '' - function() - hl.exec_cmd("waybar") + hl.monitor(${toLua {} defaultMonitor}) - hl.monitor(${lib.generators.toLua {} defaultMonitor}) + ${lib.concatMapStringsSep "\n" + (m: "hl.monitor(${toLua {} m})") + cfg.monitors} + end + '') + ]) - ${lib.concatMapStringsSep "\n" - (m: "hl.monitor(${lib.generators.toLua {} m})") - cfg.monitors} - end'') + (mkArgs [ + "config.reloaded" + (mkLuaInline '' + function() + hl.monitor(${toLua {} defaultMonitor}) + + ${lib.concatMapStringsSep "\n" + (m: "hl.monitor(${toLua {} m})") + cfg.monitors} + end + '') + ]) ]; }; };