On Mon, Apr 2, 2012 at 6:09 PM, Uli Schlachter <[email protected]> wrote:
> Don't you think that might have something to do with the number of patches
> that
> you send in? :-)
Yeah, that too :).
On a related note, in my rc.lua, instead of separately defining ror
bindings for each client separately, I hook them on to my rules table.
Let me illustrate:
{ rule_any = { class = {"Iceweasel", "Google-chrome"} },
except_any = { name = { "Chat" }, role = { "Manager" } },
ror = { exec = config.global.browser, key = "i" }
},
Note the 'ror' key in that rule snippet. Later in my rc.lua, I have:
for _, entry in ipairs(awful.rules.rules) do
if entry.ror then
globalkeys = awful.util.table.join( globalkeys,
awful.key({ config.global.modkey, }, entry.ror.key,
function()
local filter = function (c)
return (awful.rules.match(c, entry.rule) or
awful.rules.match_any(c, entry.rule_any)) and
(not awful.rules.match(c, entry.except) and
not awful.rules.match_any(c, entry.except_any))
end
awful.client.run_or_raise(entry.ror.exec, filter,
entry.ror.merge)
end))
end
end
So any rule with an ror key automatically gets its keybinding. I was
wondering if something like this could make its way upstream. And
how? Can't have it in awful.rules.apply because it doesn't have
access to the globalkeys table. Can't have it in callbacks because it
is executed only when the client starts. Also note the redundancy of
the filter function with the condition in awful.rules.apply.
Thoughts?
--
Anurag Priyam
--
To unsubscribe, send mail to [email protected].