From 9c4de3e4a9eb8da6eba7c4863d44b2f13f66732d Mon Sep 17 00:00:00 2001 From: zachir Date: Sat, 25 Dec 2021 14:47:55 -0600 Subject: add window swallowing (a la dwm) --- rc.lua | 32 ++++++++++++++++++++++++++++++-- 1 file changed, 30 insertions(+), 2 deletions(-) (limited to 'rc.lua') diff --git a/rc.lua b/rc.lua index 11da417..42aeaf5 100644 --- a/rc.lua +++ b/rc.lua @@ -250,7 +250,6 @@ awful.screen.connect_for_each_screen(function(s) timeout = 1, }, volume_widget { - volume_audio_controller = "pipewire", path_to_icon = "/usr/share/icons/Paper/scalable/status/audio-volume-muted-symbolic.svg", mute_color = "#ff111111", }, @@ -692,7 +691,7 @@ client.connect_signal("manage", function(c) copy_size(c, parent_client) end end) -]] +--]] --[[ client.connect_signal("manage", function(c) if is_terminal(c) then @@ -710,6 +709,35 @@ client.connect_signal("manage", function(c) end end) --]] +---[[ +function is_terminal(c) + return (c.class and (c.class:match("Alacritty") or c.class:match("St"))) and true or false +end + +-- swallow +client.connect_signal("manage", function(c) + if is_terminal(c) then + return + end + + local parent_client=awful.client.focus.history.get(c.screen, 1) + + awful.spawn.easy_async('dash '..awful.util.get_configuration_dir()..'helper.sh gppid '..c.pid, function (gppid) + awful.spawn.easy_async('dash '..awful.util.get_configuration_dir()..'helper.sh ppid '..c.pid, function(ppid) + if parent_client and (gppid:find('^' .. parent_client.pid) or ppid:find('^' .. parent_client.pid))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) + + if (c.floating) then + copy_size(c, parent_client) + end + end + end) + end) +end) +--]] -- }}} -- {{{ Autostart -- cgit v1.2.3