summaryrefslogtreecommitdiff
path: root/ram-widget
diff options
context:
space:
mode:
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 49a3ad6..49a7d3b 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
@@ -44,6 +44,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)
@@ -51,7 +52,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+)')
@@ -76,7 +77,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