diff options
author | Peter Palfrader <peter@palfrader.org> | 2019-09-03 10:28:31 +0200 |
---|---|---|
committer | Peter Palfrader <peter@palfrader.org> | 2019-09-03 10:28:31 +0200 |
commit | 049d195b017bc64e6d9068bd0a9ec90f0add503b (patch) | |
tree | 225631f77ac5e3fa39b385a424c697488e236a90 | |
parent | eafb097b1cc90f81ec80013af35e2ceac7aa8838 (diff) |
switch to gears.timer
-rw-r--r-- | config/awesome/battery.lua | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/config/awesome/battery.lua b/config/awesome/battery.lua index 9d78172..28e7033 100644 --- a/config/awesome/battery.lua +++ b/config/awesome/battery.lua @@ -1,4 +1,5 @@ -- TODO: switch to async IO: https://github.com/Elv13/awesome-configs/blob/master/widgets/battery.lua +local gears = require("gears") local naughty = require("naughty") local beautiful = require("beautiful") @@ -71,12 +72,11 @@ local wibox = require("wibox") battery_widget = wibox.widget.textbox() battery_widget:set_align("right") -batteryInfoUpdate( {"BAT0", "BAT1"}, battery_widget) - -battery_timer = timer({timeout = 20}) -battery_timer:connect_signal("timeout", function() - batteryInfoUpdate( {"BAT0", "BAT1"}, battery_widget) -end) -battery_timer:start() - +battery_timer = gears.timer({timeout = 20, + call_now = true, + autostart = true, + callback = function() + batteryInfoUpdate( {"BAT0", "BAT1"}, battery_widget) + end, + }) -- vim:set softtabstop=4:ts=4:shiftwidth=4:et=1: |