Try and focus no matter what

This commit is contained in:
Yessiest 2023-03-11 13:09:55 +04:00
parent 0b6b06b6a7
commit ecb870fd48
1 changed files with 12 additions and 1 deletions

View File

@ -232,7 +232,8 @@ client.connect_signal("manage",function(c)
end end
end) end)
end --}}} end --}}}
-- Find a client to focus on
-- Find a client to focus on when switching tags
for s in screen do for s in screen do
for _,t in pairs(awful.tag.gettags(s)) do for _,t in pairs(awful.tag.gettags(s)) do
t:connect_signal("property::selected", function(t) t:connect_signal("property::selected", function(t)
@ -245,3 +246,13 @@ for s in screen do
end) end)
end end
end end
-- Focus on the previous client once the newer client is closed
client.connect_signal("unmanage",function(c)
local focused_clients = screen.primary.clients
local prev
for _,v in pairs(focused_clients) do
if v == c then break end
prev = v
end
client.focus = prev
end)