This commit is contained in:
snxraven 2021-09-23 19:58:17 -04:00
parent 471c22cfd2
commit 9c8004580a

10
main.js
View File

@ -7,9 +7,6 @@ const battery = require("battery");
const fs = require('fs');
const os = require('os');
const isNotDefined = require("is-not-defined");
function cpuUsage(cb, core, sampleMs) {
var deltaUsed;
var deltaIdle;
@ -42,8 +39,6 @@ process.on('uncaughtException', err => {
process.exit(1) //mandatory (as per the Node.js docs)
})
// The cache file
const file = '/home/raven/Documents/cache.json'
@ -107,7 +102,6 @@ async function update() {
cpuUsage(perc => lb.append(lb.left + "RavenScott | CPU: ".lbFg("#fff") + (Math.round(perc * 100) / 100).toFixed(2).lbFg("#fff")));
// Check the cache SSID
jsonfile.readFile(file, function (err, obj) {
if (err) console.error(err)
@ -122,7 +116,6 @@ async function update() {
lb.append(lb.right + (" " + new Date().toDateString().lbFg("#fff") + " | BAT: ".lbFg("#fff") + level.toString().lbFg("#fff") + " " + "| WIFI: ".lbFg("#fff") + wifiSSID.toString().lbFg("#fff")).lbSwap)
}
monitor.getActiveWindow((err, window) => {
if (!err) {
lb.append((lb.center + window.app.lbFg("#fff")))
@ -135,10 +128,7 @@ async function update() {
lb.write()
})
})
}
update()