Looking for direction with reagarding a top/htop like app
Hey All,
I write alot of generalized scripts for watching processes, cpu/mem usage etc... I am looking at writing an app that posts new data to the screen, similar to top or htop. Mainly i am after how you get the "static" looking screen and just update that as needed. Not looking for code, but if anyone can point me in the right direction on google, i would greatly appreciate it. If my question is too vague, please let me know. Thanks, ~ |
Hello,
Usually people use "curses" for that. You can watch the source code of some applications that use it to get detailed examples. Usually its used in C programs but there are bindings to other languages (I know iotop uses it in python for example). But you can do it 'as well' in a shell script although it might be somewhat slow, but if it's only for a little script of your own, why not. In that case, tput can help you. An small example : Code:
tput clear Hope this helps. |
Hey,
Thanks for the info, I am open to other languages for this app, kinda started with shell at random. I will check into tput as well some python or c and see what i can dig up. Thanks much. :) ~ |
See Tcl/Tk http://en.wikipedia.org/wiki/Tcl; typically interfaced with Perl.
|
All times are GMT -5. The time now is 06:13 PM. |