1

There are recipes on how to change focus on mouse move or client change. But what I want, is to prevent any window from stealing focus. E.g. I open a new terminal via the default meta-Enter shortcut, and when it opens it immediately steals focus. Is there any way to prevent it?

Eugene Pakhomov
  • 9,309
  • 3
  • 27
  • 53

1 Answers1

2

Yes, it's possible. Focus events can happen in many ways. In the case of the new clients, just comment the focus line in your rules.

For the focus follow mouse, remove the client.focus = c in the mouse::enter section of rc.lua

For specific clients, you can add focus filters:

https://awesomewm.org/apidoc/libraries/awful.ewmh.html#add_activate_filter

For the deepest and most advanced focus control, you can disconnect the default focus handler (awful.ewmh.activate) from the request::activate (Awesome 4.0+) signal and implement your own. In that case, you will have absolute control over every focus events.

  • Strange, commenting out `focus` line in the rules didn't change anything. But adding a filter via `add_activate_filter` that always returns false did the trick. Thanks! – Eugene Pakhomov Mar 04 '17 at 14:39