Merge pull request #1540 from copycat-killer/awful_widget_watch

awful.widget.watch: return timer too
This commit is contained in:
Emmanuel Lepage Vallée 2017-02-08 14:17:20 -05:00 committed by GitHub
commit 34273b4c87
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.
--
-- @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)
timeout = timeout or 5
base_widget = base_widget or textbox()
@ -79,7 +80,7 @@ function watch.new(command, timeout, callback, base_widget)
end)
t:start()
t:emit_signal("timeout")
return base_widget
return base_widget, t
end
function watch.mt.__call(_, ...)