From a8cd242a269d764753e2472a412c171e7177a717 Mon Sep 17 00:00:00 2001 From: Steve Beaulac Date: Fri, 28 Aug 2026 11:58:50 -0400 Subject: [PATCH] feat(hyprland): make M key layout-aware for swap/consume-or-expel --- config/hypr/hyprland.lua | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/config/hypr/hyprland.lua b/config/hypr/hyprland.lua index fa4621b..62d4a9e 100644 --- a/config/hypr/hyprland.lua +++ b/config/hypr/hyprland.lua @@ -339,7 +339,15 @@ hl.bind(LEADER .. "ALT + Tab", hl.dsp.focus({ workspace = "previous", on_current -- arrange split ratio hl.bind(LEADER .. "X", toggle_master, { description = "Layout: Toggle master size" }) -- hl.bind(LEADER .. "equal", hl.dsp.layout("mfact exact 0.5")) -hl.bind(LEADER .. "M", hl.dsp.layout("swapwithmaster")) +hl.bind(LEADER .. "M", function() + local current_layout = hl.get_config("general.layout") + if current_layout == "master" then + hl.dispatch(hl.dsp.layout("swapwithmaster")) + end + if current_layout == "scrolling" then + hl.dispatch(hl.dsp.layout("consume_or_expel next")) + end +end, { description = "Layout: Swap with master" }) -- hl.bind(LEADER .. "M", hl.dsp.layout("rollnext")) hl.bind(LEADER .. "period", function()