diff options
author | Peter Palfrader <peter@palfrader.org> | 2016-12-19 07:53:51 +0100 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2016-12-19 08:50:01 +0100 |
commit | 99a81d2117b50ce461324ad622a6658f164c4f4d (patch) | |
tree | bd46f4ce59cf94117dbc560bab53b7ce3587238a /config | |
parent | 38fed1492cc8e6c2ced7baa56091d9f983dd6845 (diff) |
change focus to item under mouse after tag change
Diffstat (limited to 'config')
-rw-r--r-- | config/awesome/rc.lua | 20 |
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" |