Reply
Thread Tools
clort's Avatar
Posts: 106 | Thanked: 313 times | Joined on Mar 2019
#1
I wanted some status info in the Osso-Xterm window title so I made a script to show Temp, CPU%, Memory, Download speed, Upload Speed.



I am unsure whether the %CPU calculation makes sense for what you'd want it to show.
CPU use is sourced from /proc/stat https://www.linuxhowtos.org/System/procstat.htm
I would be happy to hear your thoughts on this.
Attached Images
 
Attached Files
File Type: txt ml-winstats.txt (2.3 KB, 43 views)

Last edited by clort; 2021-12-03 at 23:14.
 

The Following 4 Users Say Thank You to clort For This Useful Post:
nonsuch's Avatar
Posts: 584 | Thanked: 1,550 times | Joined on Sep 2019
#2
Originally Posted by clort View Post
I am unsure whether the %CPU calculation makes sense for what you'd want it to show.
It does some sort of averaging, that's the most important thing.
Testing it on my desktop the values are close enough to a similar script I once wrote, but conky and htop think it's only half that. Why that is, I have no idea.

Also see here.
__________________
N900 in 2020
SFOS in 2021
 

The Following 2 Users Say Thank You to nonsuch For This Useful Post:
Community Council | Posts: 680 | Thanked: 1,227 times | Joined on Sep 2010 @ Mbabane
#3
won't this keep CPU busy?
__________________
N900, the essence of life
 

The Following 2 Users Say Thank You to sicelo For This Useful Post:
clort's Avatar
Posts: 106 | Thanked: 313 times | Joined on Mar 2019
#4
Originally Posted by sicelo View Post
won't this keep CPU busy?
It will use cpu for a fraction of a second while running, then it won't use cpu when it sleeps. The default is to sleep 3 seconds between updates.

An improvement would be to write something that sleeps when screen is off.

I think that requires compiled program that uses MCE. At that point it's better to make a widget.

Last edited by clort; 2021-12-08 at 06:20.
 

The Following 3 Users Say Thank You to clort For This Useful Post:
Posts: 470 | Thanked: 610 times | Joined on Feb 2012
#5
Originally Posted by clort View Post
I think that requires compiled program that uses MCE. At that point it's better to make a widget.
Your script is good example for writing to Xterm title.
And I think you can make widget easily with:
http://maemo.org/packages/view/desktop-cmd-exec/

Last edited by teroyk; 2022-04-11 at 07:52.
 

The Following User Says Thank You to teroyk For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 12:53.