[modules/memory] Show used instead of free RAM

This commit is contained in:
Tobias Witek 2016-11-03 19:45:48 +01:00
parent 29131e2f65
commit 6e8acc2765

View file

@ -22,10 +22,9 @@ class Module(bumblebee.module.Module):
def data(self): def data(self):
self._mem = psutil.virtual_memory() self._mem = psutil.virtual_memory()
free = self._mem.available used = self._mem.total - self._mem.available
total = self._mem.total
return "{}/{} ({:05.02f}%)".format(bumblebee.util.bytefmt(self._mem.available), bumblebee.util.bytefmt(self._mem.total), 100.0 - self._mem.percent) return "{}/{} ({:05.02f}%)".format(bumblebee.util.bytefmt(used), bumblebee.util.bytefmt(self._mem.total), self._mem.percent)
def warning(self): def warning(self):
return self._mem.percent < 20 return self._mem.percent < 20