summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--rc.lua5
1 files changed, 3 insertions, 2 deletions
diff --git a/rc.lua b/rc.lua
index 7194651..d9fe7a9 100644
--- a/rc.lua
+++ b/rc.lua
@@ -223,9 +223,10 @@ vicious.register(mpdwidget, vicious.widgets.mpd,
memwidget = lain.widget.mem({
settings = function()
int_mem_now_used = tonumber(mem_now.used)
- widget:set_markup(markup.fg.color("#dda", "🐏 " .. mem_now.used .. "M (" .. mem_now.perc .. "%)"))
+ local perc_total = math.floor((mem_now.used + mem_now.swapused) / (mem_now.total + mem_now.swap) * 100)
+ widget:set_markup(markup.fg.color("#dda", "🐏 " .. mem_now.used .. "M (" .. perc_total .. "%)"))
- if notify_ram and mem_now.perc >= 85 then
+ if notify_ram and mem_now.perc_total >= 85 then
naughty.notify({ preset = naughty.config.presets.critical,
title = "Niveau de RM",
text = "L'utilisation de la RAM dépasse 85%",