You are not logged in.

#1 2021-07-31 10:52:46

hjkl
Member
From: Europe
Registered: 2021-07-22
Posts: 5

Get CPU percentage & RAM percentage in terminal for status.

Hi there,

I just switched to i3 and I'm using i3blocks, not i3status (where that's already done)

How would I figure out the summarized CPU percentage (as in, not per core)  and the RAM percentage used? I tried looking at slstatuses & i3status's source code but couldn't figure out anything on how to translate those to shellscript.

Then I tried via google, I didn't find anything useful other than using top to figure it out which wouldn't work since it's supposed to be in a status.

Thanks.

Last edited by hjkl (2021-07-31 10:53:31)

Offline

#2 2021-07-31 12:18:08

seth
Member
From: Won't reply 2 private help req
Registered: 2012-09-03
Posts: 77,366

Re: Get CPU percentage & RAM percentage in terminal for status.

/proc/stat for the cpu, /proc/meminfo for the RAM.
The cpu load has to be calculated as difference, https://stackoverflow.com/questions/233 … e-in-linux

Offline

#3 2021-07-31 12:52:31

hjkl
Member
From: Europe
Registered: 2021-07-22
Posts: 5

Re: Get CPU percentage & RAM percentage in terminal for status.

seth wrote:

/proc/stat for the cpu, /proc/meminfo for the RAM.
The cpu load has to be calculated as difference, https://stackoverflow.com/questions/233 … e-in-linux

Thank you, i didn't know about those.

Offline

Board footer

Powered by FluxBB