diff options
author | streetturtle <streetturtle@gmail.com> | 2020-12-06 14:47:40 -0500 |
---|---|---|
committer | streetturtle <streetturtle@gmail.com> | 2020-12-06 14:47:40 -0500 |
commit | ed2b256407291d8edadfcea9380029633cc7d9d8 (patch) | |
tree | 620436e3e2da17cb8351506a29143fb5b2165a2d /brightness-widget | |
parent | a0cd854a4d36167456bb28d255bf96a32321bf2a (diff) |
fix more warnings
Diffstat (limited to 'brightness-widget')
-rw-r--r-- | brightness-widget/brightness.lua | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/brightness-widget/brightness.lua b/brightness-widget/brightness.lua index 0cfbea4..4686041 100644 --- a/brightness-widget/brightness.lua +++ b/brightness-widget/brightness.lua @@ -17,11 +17,11 @@ local GET_BRIGHTNESS_CMD = "light -G" -- "xbacklight -get" local INC_BRIGHTNESS_CMD = "light -A 5" -- "xbacklight -inc 5" local DEC_BRIGHTNESS_CMD = "light -U 5" -- "xbacklight -dec 5" -local widget = {} +local brightness_widget = {} -local function worker(args) +local function worker(user_args) - local args = args or {} + local args = user_args or {} local get_brightness_cmd = args.get_brightness_cmd or GET_BRIGHTNESS_CMD local inc_brightness_cmd = args.inc_brightness_cmd or INC_BRIGHTNESS_CMD @@ -43,7 +43,7 @@ local function worker(args) widget = wibox.container.margin } - widget = wibox.widget { + brightness_widget = wibox.widget { brightness_icon, brightness_text, layout = wibox.layout.fixed.horizontal, @@ -52,9 +52,9 @@ local function worker(args) local update_widget = function(widget, stdout, _, _, _) local brightness_level = tonumber(string.format("%.0f", stdout)) widget:set_text(" " .. brightness_level .. "%") - end, + end - widget:connect_signal("button::press", function(_, _, _, button) + brightness_widget:connect_signal("button::press", function(_, _, _, button) if (button == 4) then spawn(inc_brightness_cmd, false) elseif (button == 5) then @@ -64,9 +64,9 @@ local function worker(args) watch(get_brightness_cmd, timeout, update_widget, brightness_text) - return widget + return brightness_widget end -return setmetatable(widget, { __call = function(_, ...) +return setmetatable(brightness_widget, { __call = function(_, ...) return worker(...) end }) |