diff --git a/home/.config/awesome/battery.lua b/home/.config/awesome/battery.lua index dff8303..013464c 100644 --- a/home/.config/awesome/battery.lua +++ b/home/.config/awesome/battery.lua @@ -8,11 +8,11 @@ local battery_widget = wibox.widget{ widget = wibox.widget.textbox } -timer = timer({ timeout = 10 }) -timer:connect_signal("timeout", function() update() end) -timer:start() +local battery_timer = timer({ timeout = 10 }) +battery_timer:connect_signal("timeout", function() battery_update() end) +battery_timer:start() -function update() +function battery_update() local percent = utils.readfile("/sys/class/power_supply/BAT1/capacity") local status = utils.readfile("/sys/class/power_supply/BAT1/status") @@ -27,6 +27,6 @@ function update() battery_widget:set_markup(prefix .. percent) end -update() +battery_update() return wibox.container.margin(battery_widget, 4) diff --git a/home/.config/awesome/divider.lua b/home/.config/awesome/divider.lua index 8d1c39d..f2ff99b 100644 --- a/home/.config/awesome/divider.lua +++ b/home/.config/awesome/divider.lua @@ -1,9 +1,9 @@ local wibox = require("wibox") -local sensors_widget = wibox.widget{ +local divider_widget = wibox.widget{ markup = '|', align = 'center', widget = wibox.widget.textbox } -return wibox.container.margin(sensors_widget, 4) +return wibox.container.margin(divider_widget, 4) diff --git a/home/.config/awesome/sensors.lua b/home/.config/awesome/sensors.lua index a439dc3..85d9a29 100644 --- a/home/.config/awesome/sensors.lua +++ b/home/.config/awesome/sensors.lua @@ -8,16 +8,16 @@ local sensors_widget = wibox.widget{ widget = wibox.widget.textbox } -timer = timer({ timeout = 10 }) -timer:connect_signal("timeout", function() update() end) -timer:start() +local sensors_timer = timer({ timeout = 10 }) +sensors_timer:connect_signal("timeout", function() sensors_update() end) +sensors_timer:start() -function update() +function sensors_update() local temp = utils.readfile("/sys/class/thermal/thermal_zone1/temp") / 1000 sensors_widget:set_markup(string.format("%02d", temp) .. "°C") end -update() +sensors_update() return wibox.container.margin(sensors_widget, 4)