Use gears.timer
This commit is contained in:
parent
bea3f2784b
commit
d694cce88b
9
mpc.lua
9
mpc.lua
@ -2,7 +2,8 @@ local awful = require("awful")
|
|||||||
local naughty = require("naughty")
|
local naughty = require("naughty")
|
||||||
local wibox = require("wibox")
|
local wibox = require("wibox")
|
||||||
|
|
||||||
local timer = timer
|
local timer = require("gears.timer")
|
||||||
|
|
||||||
local string = string
|
local string = string
|
||||||
local os = {
|
local os = {
|
||||||
getenv = os.getenv,
|
getenv = os.getenv,
|
||||||
@ -118,9 +119,9 @@ function mpc.init()
|
|||||||
end)
|
end)
|
||||||
))
|
))
|
||||||
|
|
||||||
local timer = timer { timeout = 2 }
|
local tm = timer { timeout = 2, }
|
||||||
timer:connect_signal("timeout", function() tb:set_text(music_current_short()) end)
|
tm:connect_signal("timeout", function() tb:set_text(music_current_short()) end)
|
||||||
timer:start()
|
tm:start()
|
||||||
|
|
||||||
tb:set_text(music_current_short())
|
tb:set_text(music_current_short())
|
||||||
return tb
|
return tb
|
||||||
|
@ -2,7 +2,8 @@ local awful = require("awful")
|
|||||||
local wibox = require("wibox")
|
local wibox = require("wibox")
|
||||||
local beautiful = require("beautiful")
|
local beautiful = require("beautiful")
|
||||||
|
|
||||||
local timer = timer
|
local timer = require("gears.timer")
|
||||||
|
|
||||||
local string = string
|
local string = string
|
||||||
local tonumber = tonumber
|
local tonumber = tonumber
|
||||||
local os = {
|
local os = {
|
||||||
@ -72,9 +73,9 @@ function volume_widget.init(a_mode, a_channel)
|
|||||||
tb:buttons(but)
|
tb:buttons(but)
|
||||||
img:buttons(but)
|
img:buttons(but)
|
||||||
|
|
||||||
local timer = timer { timeout = 7 }
|
local tm = timer { timeout = 7, }
|
||||||
timer:connect_signal("timeout", function() volume_widget.volume("display") end)
|
tm:connect_signal("timeout", function() volume_widget.volume("display") end)
|
||||||
timer:start()
|
tm:start()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user