summaryrefslogtreecommitdiff
path: root/rc.lua
diff options
context:
space:
mode:
authorzachir <zachir@librem.one>2021-12-25 14:47:55 -0600
committerzachir <zachir@librem.one>2021-12-25 14:47:55 -0600
commit9c4de3e4a9eb8da6eba7c4863d44b2f13f66732d (patch)
tree9400a011eed2abb76e8f21b36d245c544349f2cf /rc.lua
parent6adae30b6339c7ce135a1827e1b45770361032b0 (diff)
add window swallowing (a la dwm)
Diffstat (limited to 'rc.lua')
-rw-r--r--rc.lua32
1 files changed, 30 insertions, 2 deletions
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