awful.widget.watch: return timer too

This commit is contained in:
copycat-killer 2017-02-08 13:50:58 +01:00
parent 0afed66ccf
commit 7a728cec6b
1 changed files with 3 additions and 2 deletions

View File

@ -62,7 +62,8 @@ local watch = { mt = {} }
-- --
-- @param[opt=wibox.widget.textbox()] base_widget Base widget. -- @param[opt=wibox.widget.textbox()] base_widget Base widget.
-- --
-- @return The widget used by this watch -- @return The widget used by this watch.
-- @return Its gears.timer.
function watch.new(command, timeout, callback, base_widget) function watch.new(command, timeout, callback, base_widget)
timeout = timeout or 5 timeout = timeout or 5
base_widget = base_widget or textbox() base_widget = base_widget or textbox()
@ -79,7 +80,7 @@ function watch.new(command, timeout, callback, base_widget)
end) end)
t:start() t:start()
t:emit_signal("timeout") t:emit_signal("timeout")
return base_widget return base_widget, t
end end
function watch.mt.__call(_, ...) function watch.mt.__call(_, ...)