From 1eeded63125394b4034e848496e5c3030e385164 Mon Sep 17 00:00:00 2001 From: Blista Kanjo Date: Mon, 25 Apr 2022 03:19:34 -0400 Subject: added window manager "client swallowing" --- awesome/rc.lua | 44 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 44 insertions(+) diff --git a/awesome/rc.lua b/awesome/rc.lua index 60d512a..80e1bdd 100644 --- a/awesome/rc.lua +++ b/awesome/rc.lua @@ -656,6 +656,50 @@ gears.timer { callback = function() collectgarbage() end } +-- Client Swallowing Function + +function is_terminal(c) + return (c.class and c.class:match("Alacritty")) and true or false +end + +function copy_size(c, parent_client) + if not c or not parent_client then + return + end + if not c.valid or not parent_client.valid then + return + end + c.x=parent_client.x; + c.y=parent_client.y; + c.width=parent_client.width; + c.height=parent_client.height; +end +function check_resize_client(c) + if(c.child_resize) then + copy_size(c.child_resize, c) + end +end + +client.connect_signal("property::size", check_resize_client) +client.connect_signal("property::position", check_resize_client) +client.connect_signal("manage", function(c) + if is_terminal(c) then + return + end + local parent_client=awful.client.focus.history.get(c.screen, 1) + if parent_client and is_terminal(parent_client) then + parent_client.child_resize=c + parent_client.minimized = true + + c:connect_signal("unmanage", function() parent_client.minimized = false end) + + -- c.floating=true + copy_size(c, parent_client) + end +end) + +-- End Client Swallowing Function + -- Autostart -- cgit v1.2.3