diff --git a/lib/ruled/notification.lua b/lib/ruled/notification.lua index 1e7f0acad..548a7b654 100644 --- a/lib/ruled/notification.lua +++ b/lib/ruled/notification.lua @@ -64,6 +64,14 @@ local naughty = require("naughty") -- @clientruleproperty append_actions -- @param table +--- Set a fallback timeout the notification has no explicit timeout. +-- +-- The value is in seconds. If none is specified, the default is 5 seconds. If +-- the notification specifies its own timeout, this property will be skipped. +-- +-- @clientruleproperty implicit_timeout +-- @param number + local nrules = matcher() local function client_match_common(n, prop, value) @@ -107,6 +115,13 @@ nrules:add_property_setter("append_actions", function(n, value) n.actions = gtable.merge(new_actions, value) end) +nrules:add_property_setter("implicit_timeout", function(n, value) + -- Check if there is an explicit timeout. + if not n._private.timeout then + n.timeout = value + end +end) + local module = {} gobject._setup_class_signals(module)