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()