extract constants

This commit is contained in:
Damocles 2026-04-12 10:57:48 +02:00
parent bc3a85d18d
commit b969f0824f
22 changed files with 106 additions and 63 deletions

View file

@ -4,7 +4,7 @@ import "." as M
M.BarSection {
id: root
spacing: 2
spacing: Math.max(1, M.Theme.moduleSpacing - 2)
tooltip: "Memory: " + root.percent + "% used"
property int percent: 0
@ -16,7 +16,8 @@ M.BarSection {
const m = {};
text().split("\n").forEach(l => {
const [k, v] = l.split(":");
if (v) m[k.trim()] = parseInt(v.trim());
if (v)
m[k.trim()] = parseInt(v.trim());
});
const total = m.MemTotal;
const avail = m.MemAvailable;