diff options
-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: |