summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--config/awesome/rc.lua20
1 files changed, 20 insertions, 0 deletions
diff --git a/config/awesome/rc.lua b/config/awesome/rc.lua
index dc0a50d..9daf950 100644
--- a/config/awesome/rc.lua
+++ b/config/awesome/rc.lua
@@ -581,6 +581,26 @@ 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)
+
+-- from/inspired by https://stackoverflow.com/a/30684548
+tag.connect_signal(
+ "property::selected",
+ function (t)
+ local selected = tostring(t.selected) == "false"
+ if selected then
+ local focus_timer = timer({ timeout = 0.05 })
+ focus_timer:connect_signal("timeout", function()
+ local c = awful.mouse.client_under_pointer()
+ if not (c == nil) then
+ client.focus = c
+ -- c:raise()
+ end
+ focus_timer:stop()
+ end)
+ focus_timer:start()
+ end
+ end
+)
-- }}}
terminal = "urxvt"