summaryrefslogtreecommitdiff
path: root/ram-widget
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@gmail.com>2020-12-05 20:57:04 -0500
committerstreetturtle <streetturtle@gmail.com>2020-12-05 20:57:04 -0500
commita0cd854a4d36167456bb28d255bf96a32321bf2a (patch)
treeb42aa4e39d0b46144ed64d1d4f20e90c28465d3d /ram-widget
parentd9eb3885eea90e06b79ff8fc4b2d1c1b8f5e4cfd (diff)
fix more warnings
Diffstat (limited to 'ram-widget')
-rw-r--r--ram-widget/ram-widget.lua9
1 files changed, 5 insertions, 4 deletions
diff --git a/ram-widget/ram-widget.lua b/ram-widget/ram-widget.lua
index 66863f5..3ef5d6b 100644
--- a/ram-widget/ram-widget.lua
+++ b/ram-widget/ram-widget.lua
@@ -8,8 +8,8 @@ local wibox = require("wibox")
local ramgraph_widget = {}
-local function worker(args)
- local args = args or {}
+local function worker(user_args)
+ local args = user_args or {}
local timeout = args.timeout or 1
--- Main ram widget shown on wibar
@@ -43,6 +43,7 @@ local function worker(args)
offset = { y = 5 },
}
+ --luacheck:ignore 231
local total, used, free, shared, buff_cache, available, total_swap, used_swap, free_swap
local function getPercentage(value)
@@ -50,7 +51,7 @@ local function worker(args)
end
watch('bash -c "LANGUAGE=en_US.UTF-8 free | grep -z Mem.*Swap.*"', timeout,
- function(widget, stdout, stderr, exitreason, exitcode)
+ function(widget, stdout)
total, used, free, shared, buff_cache, available, total_swap, used_swap, free_swap =
stdout:match('(%d+)%s*(%d+)%s*(%d+)%s*(%d+)%s*(%d+)%s*(%d+)%s*Swap:%s*(%d+)%s*(%d+)%s*(%d+)')
@@ -75,7 +76,7 @@ local function worker(args)
{'free ' .. getPercentage(free + free_swap), free + free_swap},
{'buff_cache ' .. getPercentage(buff_cache), buff_cache}
}
-
+
if popup.visible then
popup.visible = not popup.visible
else