maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 7 / Leste (https://talk.maemo.org/forumdisplay.php?f=66)
-   -   Status info in Xterm Window Title (https://talk.maemo.org/showthread.php?t=101263)

clort 2021-12-03 23:01

Status info in Xterm Window Title
 
2 Attachment(s)
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.

http://0x0.st/-hVo.webp

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.

nonsuch 2021-12-04 15:09

Re: Status info in Xterm Window Title
 
Quote:

Originally Posted by clort (Post 1573009)
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.

sicelo 2021-12-05 18:56

Re: Status info in Xterm Window Title
 
won't this keep CPU busy?

clort 2021-12-05 20:45

Re: Status info in Xterm Window Title
 
Quote:

Originally Posted by sicelo (Post 1573020)
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.

teroyk 2022-04-11 07:46

Re: Status info in Xterm Window Title
 
Quote:

Originally Posted by clort (Post 1573025)
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/


All times are GMT. The time now is 10:08.

vBulletin® Version 3.8.8