summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstreetturtle <streetturtle@gmail.com>2018-04-15 14:21:46 -0400
committerstreetturtle <streetturtle@gmail.com>2018-04-15 14:21:46 -0400
commit70a82b7fd47bde2ca1107419c78b6c0f023c4cea (patch)
tree4d3deb64bc9a6357aaaec9fa79ad7e73d7ed82ea
parent70790737e5f12c063dbff29af47e4d421a94e0f1 (diff)
reformat
-rw-r--r--ram-widget/ram-widget.lua14
1 files changed, 8 insertions, 6 deletions
diff --git a/ram-widget/ram-widget.lua b/ram-widget/ram-widget.lua
index 257f0b4..d352bd7 100644
--- a/ram-widget/ram-widget.lua
+++ b/ram-widget/ram-widget.lua
@@ -45,13 +45,15 @@ end
watch('bash -c "free | grep -z Mem.*Swap.*"', 1,
function(widget, stdout, stderr, exitreason, exitcode)
- 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+)')
- widget.data = { used, total-used }
+ 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+)')
+
+ widget.data = { used, total-used } widget.data = { used, total-used }
if w.visible then
w.pie.data_list = {
- {'used ' .. getPercentage(used+used_swap), used+used_swap},
- {'free ' .. getPercentage(free+free_swap), free+free_swap},
+ {'used ' .. getPercentage(used + used_swap), used + used_swap},
+ {'free ' .. getPercentage(free + free_swap), free + free_swap},
{'buff_cache ' .. getPercentage(buff_cache), buff_cache}
}
end
@@ -64,8 +66,8 @@ ramgraph_widget:buttons(
awful.button({}, 1, function()
awful.placement.top_right(w, { margins = {top = 25, right = 10}})
w.pie.data_list = {
- {'used ' .. getPercentage(used+used_swap), used+used_swap},
- {'free ' .. getPercentage(free+free_swap), free+free_swap},
+ {'used ' .. getPercentage(used + used_swap), used + used_swap},
+ {'free ' .. getPercentage(free + free_swap), free + free_swap},
{'buff_cache ' .. getPercentage(buff_cache), buff_cache}
}
w.pie.display_labels = true