diff options
author | ache <ache@ache.one> | 2023-02-26 01:40:51 +0100 |
---|---|---|
committer | ache <ache@ache.one> | 2023-02-26 01:40:51 +0100 |
commit | 7385c4c49d9dcf581c69c942a25535bd29ce66ac (patch) | |
tree | 549a6bdc79beb792991ed2688b06b2d0aa56aff0 | |
parent | Add ghost workspace 👻 (diff) |
Show percentage of total RAM used
-rw-r--r-- | rc.lua | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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%", |