summaryrefslogtreecommitdiff
path: root/volume-widget
diff options
context:
space:
mode:
authorpmakhov <pavel.makhov@savoirfairelinux.com>2017-12-09 14:39:46 -0500
committerpmakhov <pavel.makhov@savoirfairelinux.com>2017-12-09 14:39:46 -0500
commite6c30597276edfa2637cde277d7d30209612dd5c (patch)
treebbe1b6d3b5230e0db40221a58342b7d82865997c /volume-widget
parentbce9fbdd5fea2ed9c5b2e3699150f340b1c54e57 (diff)
Possible fix for the memory leak (issue #11)
Diffstat (limited to 'volume-widget')
-rw-r--r--volume-widget/volume.lua16
1 files changed, 14 insertions, 2 deletions
diff --git a/volume-widget/volume.lua b/volume-widget/volume.lua
index c7983c3..31a66e4 100644
--- a/volume-widget/volume.lua
+++ b/volume-widget/volume.lua
@@ -1,3 +1,13 @@
+-------------------------------------------------
+-- Volume 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/volume-widget
+
+-- @author Pavel Makhov
+-- @copyright 2017 Pavel Makhov
+-------------------------------------------------
+
local awful = require("awful")
local wibox = require("wibox")
local watch = require("awful.widget.watch")
@@ -6,7 +16,7 @@ local spawn = require("awful.spawn")
local path_to_icons = "/usr/share/icons/Arc/status/symbolic/"
local request_command = 'amixer -D pulse sget Master'
-volume_widget = wibox.widget {
+local volume_widget = wibox.widget {
{
id = "icon",
image = path_to_icons .. "audio-volume-muted-symbolic.svg",
@@ -48,4 +58,6 @@ volume_widget:connect_signal("button::press", function(_,_,_,button)
end)
end)
-watch(request_command, 1, update_graphic, volume_widget) \ No newline at end of file
+watch(request_command, 1, update_graphic, volume_widget)
+
+return volume_widget \ No newline at end of file