Assuming the destination awful.rules.rules from lines 357-375, this awesomerc.lua file is in your custom awesomerc.lua file, and the awful.client.focus.filter used in this destination is that of this file , then you should be able to do something like this.
Define a custom focus filter function somewhere in your rc file.
function custom_focus_filter(c) if global_focus_disable then return nil end return awful.client.focus.filter(c) end
Then use the custom filter function in the rule assignment instead of the original filter function.
awful.rules.rules = { -- All clients will match this rule. { rule = { }, properties = { .... focus = custom_focus_filter, .... } },
And then your switch function just needs to set and disable global if necessary.
awful.key({ modkey, "Shift" }, "f", function () global_focus_disable = not global_focus_disable end)
source share