summaryrefslogtreecommitdiff
path: root/ram-widget
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@users.noreply.github.com>2020-12-07 15:33:55 -0500
committerGitHub <noreply@github.com>2020-12-07 15:33:55 -0500
commitd4971690cec1e074999e730d87045e578d71e43c (patch)
treeb0f05079840eba5467e14bdcd093ad3ed5362cf4 /ram-widget
parentf078748e76eacae599cf0ad06120d9fff54f8fa5 (diff)
parented2b256407291d8edadfcea9380029633cc7d9d8 (diff)
Merge pull request #224 from streetturtle/comply-with-luacheck
Comply with luacheck
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