LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices

Reply
 
Search this Thread
Old 09-21-2009, 10:59 PM   #1
energyAlchemist
LQ Newbie
 
Registered: Sep 2009
Posts: 3

Rep: Reputation: 0
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,
~

Last edited by energyAlchemist; 09-21-2009 at 11:03 PM.
 
Old 09-22-2009, 02:39 AM   #2
antegallya
Member
 
Registered: Jun 2008
Location: Belgium
Distribution: Debian
Posts: 109

Rep: Reputation: 42
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
tput cup 10 10
echo "Hello"
tput cup 11 16
echo "World"
you can read the man page to get some extra information.

Hope this helps.
 
Old 09-22-2009, 03:07 AM   #3
energyAlchemist
LQ Newbie
 
Registered: Sep 2009
Posts: 3

Original Poster
Rep: Reputation: 0
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.

~
 
Old 09-22-2009, 08:39 PM   #4
chrism01
Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.5, Centos 5.10
Posts: 16,251

Rep: Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026Reputation: 2026
See Tcl/Tk http://en.wikipedia.org/wiki/Tcl; typically interfaced with Perl.
 
  


Reply

Tags
bash, scripts


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
error while try to install htop-0.8 Elnegro8 Linux - Software 5 08-26-2013 02:36 PM
LXer: Htop, a tip-top ncurses interactive tool for system monitoring your desktop LXer Syndicated Linux News 0 03-26-2009 02:21 PM
Need Help reagarding Kernel Debugger linux_mani Linux - Newbie 0 12-12-2008 05:35 AM
Reagarding Vi editor linuxjamil Linux - Server 3 08-03-2007 09:14 AM
kde app always on top mikegorb Linux - Software 2 07-17-2005 01:37 AM


All times are GMT -5. The time now is 11:42 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration