aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--awesome/rc.lua44
1 files changed, 44 insertions, 0 deletions
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