extract constants
This commit is contained in:
parent
bc3a85d18d
commit
b969f0824f
22 changed files with 106 additions and 63 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue