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