From 3da0546c902a5a238f56ac365617aef50d4ad458 Mon Sep 17 00:00:00 2001 From: Konfekt Date: Sun, 25 Dec 2022 21:06:44 +0100 Subject: [PATCH] switch to parent window after closing child window as gladly donated by @basaran see https://github.com/lcpz/awesome-copycats/issues/301 --- rc.lua.template | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/rc.lua.template b/rc.lua.template index c7d6583..3b4c7bc 100644 --- a/rc.lua.template +++ b/rc.lua.template @@ -811,4 +811,21 @@ end) client.connect_signal("focus", function(c) c.border_color = beautiful.border_focus end) client.connect_signal("unfocus", function(c) c.border_color = beautiful.border_normal end) +-- switch to parent after closing child window +local function backham() + local s = awful.screen.focused() + local c = awful.client.focus.history.get(s, 0) + if c then + client.focus = c + c:raise() + end +end + +-- attach to minimized state +client.connect_signal("property::minimized", backham) +-- attach to closed state +client.connect_signal("unmanage", backham) +-- ensure there is always a selected client during tag switching or logins +tag.connect_signal("property::selected", backham) + -- }}}