From 161576e2cdc8eed75840858459186ff7d7f13c09 Mon Sep 17 00:00:00 2001 From: Mark Date: Sun, 24 Apr 2022 12:27:54 -0700 Subject: [PATCH] Minor cleanup --- classes/backlight/arc_widget.lua | 2 +- classes/backlight/backlight.lua | 3 +-- classes/battery/arc_widget.lua | 2 +- classes/battery/battery.lua | 2 +- classes/battery/prog_widget.lua | 2 +- classes/mpc/mpc.lua | 2 +- classes/mpc/widget.lua | 2 +- classes/volume/arc_widget.lua | 2 +- classes/volume/bar_widget.lua | 2 +- classes/volume/volume.lua | 2 +- 10 files changed, 10 insertions(+), 11 deletions(-) diff --git a/classes/backlight/arc_widget.lua b/classes/backlight/arc_widget.lua index 45e6bb7..27b6cba 100644 --- a/classes/backlight/arc_widget.lua +++ b/classes/backlight/arc_widget.lua @@ -1,4 +1,5 @@ local P = {} +P.__index = P function P:set_value(value) -- Set widget value. (0 - 100) @@ -30,7 +31,6 @@ end function P:new() local widget = {} setmetatable(widget, self) - self.__index = self widget.icon = wibox.widget { id = "icon", diff --git a/classes/backlight/backlight.lua b/classes/backlight/backlight.lua index c14cb2b..9d9406e 100644 --- a/classes/backlight/backlight.lua +++ b/classes/backlight/backlight.lua @@ -5,7 +5,7 @@ local widget_types = { local P = { name = "backlight" } - +P.__index = P --- -- Internal methods @@ -101,7 +101,6 @@ function P:new(args) -- do nothing. Updated in _get_status() } setmetatable(b, self) - self.__index = self b.widget = widget_types[b.widget_type]:new() diff --git a/classes/battery/arc_widget.lua b/classes/battery/arc_widget.lua index ba4d3f8..413bb6b 100644 --- a/classes/battery/arc_widget.lua +++ b/classes/battery/arc_widget.lua @@ -1,4 +1,5 @@ local P = {} +P.__index = P function P:set_value(value) -- Set widget value. (0 - 100) @@ -68,7 +69,6 @@ function P:new() state = "error" } setmetatable(widget, self) - self.__index = self widget.icon = wibox.widget { image = beautiful.icons.battery.missing, diff --git a/classes/battery/battery.lua b/classes/battery/battery.lua index 305ae46..ff5ed14 100644 --- a/classes/battery/battery.lua +++ b/classes/battery/battery.lua @@ -6,7 +6,7 @@ local widget_types = { local P = { name = "battery" } - +P.__index = P --- -- Internal methods diff --git a/classes/battery/prog_widget.lua b/classes/battery/prog_widget.lua index 1fd6d75..df9ffcb 100644 --- a/classes/battery/prog_widget.lua +++ b/classes/battery/prog_widget.lua @@ -1,4 +1,5 @@ local P = {} +P.__index = P function P:set_value(value) -- Set widget value. (0 - 100) @@ -50,7 +51,6 @@ function P:new() state = "error" } setmetatable(widget, self) - self.__index = self widget.progressbar = wibox.widget { max_value = 100, diff --git a/classes/mpc/mpc.lua b/classes/mpc/mpc.lua index 36d787a..d2992d6 100644 --- a/classes/mpc/mpc.lua +++ b/classes/mpc/mpc.lua @@ -5,6 +5,7 @@ local widget_types = { local P = { name = "mpc" } +P.__index = P --- -- Internal methods @@ -102,7 +103,6 @@ function P:new(args) mpd_host = args.mpd_host or "localhost", } setmetatable(m, self) - self.__index = self -- Create widget for this volume interface m.widget = widget_types[m.widget_type]:new() diff --git a/classes/mpc/widget.lua b/classes/mpc/widget.lua index c1bdc82..47f5a9b 100644 --- a/classes/mpc/widget.lua +++ b/classes/mpc/widget.lua @@ -1,4 +1,5 @@ local P = {} +P.__index = P function P:update(args) if (args.error ~= nil) then @@ -28,7 +29,6 @@ end function P:new() local widget = {} setmetatable(widget, self) - self.__index = self widget.title = wibox.widget.textbox("MPD is not") widget.title.valign = "center" diff --git a/classes/volume/arc_widget.lua b/classes/volume/arc_widget.lua index bc05208..9c1c2d4 100755 --- a/classes/volume/arc_widget.lua +++ b/classes/volume/arc_widget.lua @@ -1,4 +1,5 @@ local P = {} +P.__index = P function P:set_value(value) -- Set widget value. (0 - 100) @@ -34,7 +35,6 @@ end function P:new() local widget = {} setmetatable(widget, self) - self.__index = self widget.icon = wibox.widget { resize = true, diff --git a/classes/volume/bar_widget.lua b/classes/volume/bar_widget.lua index 3edd272..3fe29e2 100644 --- a/classes/volume/bar_widget.lua +++ b/classes/volume/bar_widget.lua @@ -1,4 +1,5 @@ local P = {} +P.__index = P function P:set_value(value) -- Set widget value. (0 - 100) @@ -24,7 +25,6 @@ end function P:new() local widget = {} setmetatable(widget, self) - self.__index = self widget.bar = wibox.widget { max_value = 100, diff --git a/classes/volume/volume.lua b/classes/volume/volume.lua index 02e707f..d21e5ef 100755 --- a/classes/volume/volume.lua +++ b/classes/volume/volume.lua @@ -6,6 +6,7 @@ local widget_types = { local P = { name = "volume" } +P.__index = P --- -- Internal methods @@ -198,7 +199,6 @@ function P:new(args) ) setmetatable(v, self) - self.__index = self -- This timer keeps mute and volume status up-to-date. v.timer = gears.timer {