awful.timer -> gears.timer

This commit is contained in:
Kolan Sh 2017-07-14 02:38:29 +03:00
parent 54aa287427
commit da1d38b4c6
1 changed files with 16 additions and 13 deletions

29
rc.lua
View File

@ -176,25 +176,28 @@ function mail_on_click()
end end
mailicon:buttons(awful.util.table.join(awful.button({ }, 1, mail_on_click))) mailicon:buttons(awful.util.table.join(awful.button({ }, 1, mail_on_click)))
local mymail_mail = wibox.widget.textbox( "?" ) local mymail_mail = wibox.widget.textbox( "?" )
mymail_mail.timer = timer{timeout=20} gears.timer {
mymail_mail.timer:connect_signal("timeout", timeout = 20,
function () mymail_mail:set_text ( mail_count(mail_tmp_path.."/mymail_count") ) end) autostart = true,
mymail_mail.timer:start() callback = function() mymail_mail:set_text ( mail_count(mail_tmp_path.."/mymail_count") ) end
}
mymail_mail:buttons(mailicon:buttons()) mymail_mail:buttons(mailicon:buttons())
-- local gmail_mail = wibox.widget.textbox( "?" ) -- local gmail_mail = wibox.widget.textbox( "?" )
-- gmail_mail.timer = timer{timeout=20} -- gears.timer {
-- gmail_mail.timer:connect_signal("timeout", -- timeout = 20,
-- function () gmail_mail:set_text ( mail_count(mail_tmp_path.."/gmail_count") ) end) -- autostart = true,
-- gmail_mail.timer:start() -- callback = function() gmail_mail:set_text ( mail_count(mail_tmp_path.."/gmail_count") ) end
-- }
-- gmail_mail:buttons(mailicon:buttons()) -- gmail_mail:buttons(mailicon:buttons())
-- nVidia Optimus -- nVidia Optimus
local optimus_icon = wibox.widget.imagebox() local optimus_icon = wibox.widget.imagebox()
local optimus_overclocked = false local optimus_overclocked = false
optimus_icon:set_image(beautiful.widget_optimus_off) optimus_icon:set_image(beautiful.widget_optimus_off)
optimus_icon.timer = timer{timeout=3} gears.timer {
optimus_icon.timer:connect_signal("timeout", timeout = 3,
function () autostart = true,
callback = function()
local f = io.open("/proc/acpi/bbswitch", "r") local f = io.open("/proc/acpi/bbswitch", "r")
local l = nil local l = nil
if f ~= nil then if f ~= nil then
@ -213,8 +216,8 @@ optimus_icon.timer:connect_signal("timeout",
else else
optimus_icon:set_image(beautiful.widget_optimus_off) optimus_icon:set_image(beautiful.widget_optimus_off)
end end
end) end
optimus_icon.timer:start() }
optimus_icon:buttons(awful.util.table.join( optimus_icon:buttons(awful.util.table.join(
awful.button({ }, 1, awful.button({ }, 1,
function () function ()