Menu

karamba window displaying top

Help
Sean Brown
2003-08-17
2003-08-18
  • Sean Brown

    Sean Brown - 2003-08-17

    I am trying to have a superkaramba window display the output of top, at the moment it just creates the transparent box but does not display text. This is my first theme attempt and am banging my head against the desk trying to get it, this is what i have so far, any help would be appereciated.

    karamba x=777 y=584 w=640 h=480 LOCKED=true TEXT align=center sensor=program color=0,0,255 program="top"

     
    • James Sparenberg

      Sounded neat... tried an experiment and I discovered something.  The "output" of top isn't pure text .   (if you do /usr/bin/top > topout.txt you'll see what I mean.)  Looks as if somehow it would need to go through a filter to work. 

      A quick example of one that did work is

      KARAMBA X=10 Y=10 W=400 H=800 LOCKED=true INTERVAL=2000

      IMAGE X=0 Y=0 PATH=" "

      <GROUP> x=10 y=10
              TEXT X=0 Y=0 SENSOR=PROGRAM PROGRAM="ps ax" FONTSIZE=6 FONT="Verdana" COLOR=0,0,0 INTERVAL=2000
      </GROUP>

      but the same thing with top outputs a blank "page" if you will.

       
      • Adam Geitgey

        Adam Geitgey - 2003-08-17

        You are right - top doesn't output text.  It actually displays stuff to the screen using control codes like an actual program.  That is far too complex for SuperKaramba to display directly.  To get the same result, itstead of using "top" as your command, try this command:

        ps aux --sort=-%cpu

        That should give you the same thing and actually work.  You can play around with ps options to get it exactly how you want.

        Just for future reference, you can get basically any info about you system, its hardware, and its running programs directly in text form by poking around the /proc directory.  Anything in there can be directly displayed in SuperKaramba too.

         
    • Sean Brown

      Sean Brown - 2003-08-18

      thanks, the ps aux --sort=-%cpu works alright for now.

       

Log in to post a comment.