diff --git a/lib/naughty.lua.in b/lib/naughty.lua.in
index 021efec4..59f18e51 100644
--- a/lib/naughty.lua.in
+++ b/lib/naughty.lua.in
@@ -205,6 +205,7 @@ end
-- @param ontop Target screen for the notification
-- @param run Function to run on left click
-- @param width The popup width
+-- @field hover_timeout Delay in seconds after which hovered popup disappears.
-- @param replaces_id Replace the notification with the given ID
-- @usage naughty.notify({ title = 'Achtung!', text = 'You\'re idling', timeout = 0 })
-- @return The notification object
@@ -217,6 +218,7 @@ function notify(args)
local screen = args.screen or config.screen
local ontop = args.ontop or config.ontop
local width = args.width or config.width
+ local hover_timeout = args.hover_timeout or config.hover_timeout
-- beautiful
local beautiful = bt.get()
@@ -260,8 +262,8 @@ function notify(args)
local run = args.run or die
local hover_destroy = function ()
- if config.hover_timeout == 0 then die()
- else hooks.timer.register(config.hover_timeout, die) end
+ if hover_timeout == 0 then die()
+ else hooks.timer.register(hover_timeout, die) end
end
-- create textbox
@@ -269,7 +271,7 @@ function notify(args)
textbox:buttons({ button({ }, 1, run),
button({ }, 3, die) })
textbox.text = string.format('%s%s', font, title, text)
- if config.hover_timeout then textbox.mouse_enter = hover_destroy end
+ if hover_timeout then textbox.mouse_enter = hover_destroy end
-- create iconbox
local iconbox = nil
@@ -287,7 +289,7 @@ function notify(args)
end
iconbox.resize = false
iconbox.image = img
- if config.hover_timeout then iconbox.mouse_enter = hover_destroy end
+ if hover_timeout then iconbox.mouse_enter = hover_destroy end
end
end