Use gears.timer

master
Guillaume Dott 2017-01-23 15:28:22 +01:00
parent bea3f2784b
commit d694cce88b
2 changed files with 10 additions and 8 deletions

View File

@ -2,7 +2,8 @@ local awful = require("awful")
local naughty = require("naughty")
local wibox = require("wibox")
local timer = timer
local timer = require("gears.timer")
local string = string
local os = {
getenv = os.getenv,
@ -118,9 +119,9 @@ function mpc.init()
end)
))
local timer = timer { timeout = 2 }
timer:connect_signal("timeout", function() tb:set_text(music_current_short()) end)
timer:start()
local tm = timer { timeout = 2, }
tm:connect_signal("timeout", function() tb:set_text(music_current_short()) end)
tm:start()
tb:set_text(music_current_short())
return tb

View File

@ -2,7 +2,8 @@ local awful = require("awful")
local wibox = require("wibox")
local beautiful = require("beautiful")
local timer = timer
local timer = require("gears.timer")
local string = string
local tonumber = tonumber
local os = {
@ -72,9 +73,9 @@ function volume_widget.init(a_mode, a_channel)
tb:buttons(but)
img:buttons(but)
local timer = timer { timeout = 7 }
timer:connect_signal("timeout", function() volume_widget.volume("display") end)
timer:start()
local tm = timer { timeout = 7, }
tm:connect_signal("timeout", function() volume_widget.volume("display") end)
tm:start()
end