I am running a script which creates and closes several windows, hence, I added to my rc.lua a way to keep the window where I am working always on top:
awful.key({ modkey, "Control" }, "space",
function(c)
awful.client.floating.toggle()
c.ontop = not c.ontop
end),
The problem is:when the new window is created, I lose the focus, which passes to the new window.
Is there a way to make that the previous toggle not only keep the window on top, but also with the focus until I toggle it again?
Assuming the
awful.rules.rules
assignment from lines 357-375 of this awesomerc.lua file are in your user'sawesomerc.lua
file and theawful.client.focus.filter
used in that assignment is the one from this file then you should be able to do something like this.Define a custom focus filter function somewhere in your rc file.
Then use that custom filter function in the rules assignment in place of the original filter function.
And then your toggle function just needs to set and unset the global as appropriate.