diff options
-rwxr-xr-x | helper.sh | 13 | ||||
-rw-r--r-- | rc.lua | 32 |
2 files changed, 43 insertions, 2 deletions
diff --git a/helper.sh b/helper.sh new file mode 100755 index 0000000..d51fbab --- /dev/null +++ b/helper.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +ppid() { + printf "$(ps -o ppid= -p $1)" | xargs +} + +gppid() { + PARENT=$(ps -o ppid= -p $1) + GRANDPARENT=$(ps -o ppid= -p $PARENT) + printf "$GRANDPARENT" | xargs +} + +$@ @@ -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 |