awesomewm-backham/init.lua

31 lines
842 B
Lua
Raw Permalink Normal View History

2021-06-04 08:58:44 +02:00
--+ allows automatically focusing back to the previous client
--> on window close (unmanage) or minimize.
2022-12-07 10:30:38 +01:00
-------------------------------------------------------------------> imports ;
local awful = require("awful")
2021-06-04 08:58:44 +02:00
-------------------------------------------------------------------> methods ;
2021-05-28 08:08:25 +02:00
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
2021-06-04 08:58:44 +02:00
--------------------------------------------------------------------> signal ;
2021-05-28 08:08:25 +02:00
client.connect_signal("property::minimized", backham)
2021-06-04 08:58:44 +02:00
--+ attach to minimized state
2021-05-28 08:08:25 +02:00
client.connect_signal("unmanage", backham)
2022-12-07 10:30:38 +01:00
--+ attach to closed state
tag.connect_signal("property::selected", backham)
--|ensure there is always a selected client during tag
--|switching or logins