From c6a74f5c8c62b6ff76b5669d0aea291f6d974b7c Mon Sep 17 00:00:00 2001 From: actionless Date: Thu, 19 Sep 2024 02:49:52 +0200 Subject: [PATCH] feat(config: keys): add mod+Ctrl+Home to reset layout of secondary clients --- config/keys.lua | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/config/keys.lua b/config/keys.lua index b0b6f84f..f93f8d00 100644 --- a/config/keys.lua +++ b/config/keys.lua @@ -958,14 +958,17 @@ function keys.init(awesome_context) awful.tag.incmwfact(-0.05) elseif direction == "right" then awful.tag.incmwfact( 0.05) + elseif direction == "reset_clients" then + local s = c.screen + local t = s.selected_tag + t.windowfact = {} + awful.layout.arrange(s) elseif direction == "reset" then local s = c.screen local t = s.selected_tag - if t then - t.master_width_factor = 0.5 - t.windowfact = {} - awful.layout.arrange(s) - end + t.master_width_factor = 0.5 + t.windowfact = {} + awful.layout.arrange(s) end end end @@ -1077,6 +1080,10 @@ function keys.init(awesome_context) get_resize_function("up"), "column size+", LAYOUT_MANIPULATION ), + bind_key({ modkey, "Control" }, "Home", + get_resize_function("reset_clients"), + "reset layout", LAYOUT_MANIPULATION + ), bind_key({ modkey, "Control" }, "End", get_resize_function("reset"), "reset layout", LAYOUT_MANIPULATION