Hi,
This is a small patch which adds a callback option to the rules
(lib/awful/rules.lua). It will execute when the rule matches. An example on
how it can be used:
-- Rules
awful.rules.rules = {
-- All clients will match this rule.
{ rule = { },
callback = function(c)
print('Client: ' .. c.name)
end,
properties = { } }
Kind regards,
Hiltjo Posthuma
The patch is added as an attachment. (It will apply to lib/awful/
rules.lua.in against git f3509f745a8e15d252d4d0ed81dfadc07009d425).
--- a/lib/awful/rules.lua.in 2009-11-01 12:46:39.000000000 +0100
+++ b/lib/awful/rules.lua.in 2009-11-07 19:16:02.000000000 +0100
@@ -87,6 +87,10 @@
for property, value in pairs(entry.properties) do
props[property] = value
end
+ -- Apply callback on client when rule matched.
+ if entry.callback then
+ entry.callback(c)
+ end
end
end