Skip to content
Snippets Groups Projects
Commit 34d517fe authored by Reviath's avatar Reviath
Browse files

Fixed ram usage refresh

parent 3cbad083
Branches
No related tags found
No related merge requests found
...@@ -41,6 +41,11 @@ rpc.on('ready', () => { ...@@ -41,6 +41,11 @@ rpc.on('ready', () => {
}); });
setInterval(function(){ setInterval(function(){
let totalmem = os.totalmem()/1024/1024/1000;
let freemem = os.freemem()/1024/1024/1000;
let usedmem= totalmem - freemem;
var tmem = Math.floor(totalmem);
var umem = Math.floor(usedmem);
rpc.setActivity({ rpc.setActivity({
details:`CPU: ${os.cpus().map(i => `${i.model}`)[0]}`, details:`CPU: ${os.cpus().map(i => `${i.model}`)[0]}`,
state: `RAM: ${umem}GiB/${tmem}GiB`, state: `RAM: ${umem}GiB/${tmem}GiB`,
...@@ -54,5 +59,4 @@ rpc.on('ready', () => { ...@@ -54,5 +59,4 @@ rpc.on('ready', () => {
}); });
},15000); },15000);
}); });
console.log('RPC is ready!')
rpc.login({ clientId, clientSecret }); rpc.login({ clientId, clientSecret });
<!DOCTYPE html>
<html lang="en">
<head>
<title>Presence</title>
<body>
<h1>Started RPC!</h1>
<h2>Don't quit this page</h2>
</body>
</head>
</html>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment