Comparing version 0.6.0 to 0.6.1
{ | ||
"name": "vtop", | ||
"version": "0.6.0", | ||
"version": "0.6.1", | ||
"description": "Wow such top. So stats", | ||
@@ -5,0 +5,0 @@ "homepage": "http://parall.ax/vtop", |
@@ -68,6 +68,2 @@ vtop | ||
### I think you should change CPU percentage to how Apple's Activity Monitor works. | ||
No I like it this way. Feel free to submit a PR with it as a config option though. | ||
### Can I change the color scheme? | ||
@@ -74,0 +70,0 @@ |
@@ -34,2 +34,4 @@ /** | ||
isMac: _os.platform().includes('darwin'), | ||
/** | ||
@@ -51,2 +53,19 @@ * Grab the current value, from 0-100 | ||
}) | ||
} else if (plugin.isMac) { | ||
child.exec('ps -caxm -orss,comm', (err, stdout, stderr) => { | ||
if (err) { | ||
throw err | ||
} | ||
let sp = stdout.split('\n') | ||
let total = 0 // kb | ||
for (var i = 0; i < sp.length; i++) { | ||
if (!isNaN(parseInt(sp[i].replace(/([a-zA-Z]).*/, '')))) { | ||
total += parseInt(sp[i].replace(/([a-zA-Z]).*/, '')) | ||
} | ||
} | ||
let usedmem = total / 1024 ^ 2 | ||
let freemem = os.totalmem() - usedmem | ||
let per = freemem / os.totalmem() | ||
plugin.currentValue = Math.round((1 - per) * 100) | ||
}) | ||
} else { | ||
@@ -53,0 +72,0 @@ plugin.currentValue = Math.round((1 - os.freememPercentage()) * 100) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3019517
36
1273
105