From e6c30597276edfa2637cde277d7d30209612dd5c Mon Sep 17 00:00:00 2001 From: pmakhov Date: Sat, 9 Dec 2017 14:39:46 -0500 Subject: Possible fix for the memory leak (issue #11) --- volumearc-widget/volumearc.lua | 19 ++++++++++++++----- 1 file changed, 14 insertions(+), 5 deletions(-) (limited to 'volumearc-widget') diff --git a/volumearc-widget/volumearc.lua b/volumearc-widget/volumearc.lua index 6ae5fe9..c2c0af9 100644 --- a/volumearc-widget/volumearc.lua +++ b/volumearc-widget/volumearc.lua @@ -1,3 +1,13 @@ +------------------------------------------------- +-- Volume Arc Widget for Awesome Window Manager +-- Shows the current volume level +-- More details could be found here: +-- https://github.com/streetturtle/awesome-wm-widgets/tree/master/volumearc-widget + +-- @author Pavel Makhov +-- @copyright 2017 Pavel Makhov +------------------------------------------------- + local awful = require("awful") local beautiful = require("beautiful") local spawn = require("awful.spawn") @@ -17,13 +27,10 @@ local volumearc = wibox.widget { forced_width = 17, bg = "#ffffff11", paddings = 2, - widget = wibox.container.arcchart, - set_value = function(self, value) - self.value = value - end, + widget = wibox.container.arcchart } -volumearc_widget = wibox.container.mirror(volumearc, { horizontal = true }) +local volumearc_widget = wibox.container.mirror(volumearc, { horizontal = true }) local update_graphic = function(widget, stdout, _, _, _) local mute = string.match(stdout, "%[(o%D%D?)%]") @@ -50,3 +57,5 @@ volumearc:connect_signal("button::press", function(_, _, _, button) end) watch(GET_VOLUME_CMD, 1, update_graphic, volumearc) + +return volumearc_widget \ No newline at end of file -- cgit v1.2.3