Results 1 to 8 of 8

Thread: Where's the source code?

  1. #1
    Join Date
    Feb 2007
    Location
    Bucharest
    Beans
    460
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Where's the source code?

    I'm trying to find the source code for any of these: top, gnome-system-monitor or the system monitor gnome panel applet. It seems I am unable to do that (I really don't know where to search -- tried Google but to no avail). Why I'm trying to do this is because I want to create a better alternative to `free'. For this, I need to know if there's any other way of reading available / used / total RAM (and maybe swap) memory than parsing /proc/meminfo.
    Thanks.
    [ Blog # A Programmer's Ride ]
    Linux: it really whips the penguin's butt.

  2. #2
    Join Date
    Mar 2007
    Location
    Turkey
    Beans
    1,574

    Re: Where's the source code?

    What about the output from executing "free"?

  3. #3
    Join Date
    Nov 2008
    Location
    Here, There, Everywhere
    Beans
    1,163
    Distro
    Xubuntu

    Re: Where's the source code?

    You can download the source code for any program in the repositories with apt-get source:
    Code:
    apt-get source packagename

  4. #4
    Join Date
    Feb 2007
    Location
    Bucharest
    Beans
    460
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Where's the source code?

    Quote Originally Posted by danielrmt View Post
    You can download the source code for any program in the repositories with apt-get source:
    Code:
    apt-get source packagename
    Thanks! I still can't find the source code for top or free, but I am able to find the source code for gnome-system-monitor. Do you have any idea where I can find the source code for top? If not, I'll just have to dig in the system monitor source

    Majorix: did you read my post? I want to build a better alternative to free, or maybe even improve it (if there's no other way to read the free memory than parsing /proc/meminfo). What I don't like about it is the way it rounds up numbers when using different switches. And I would like to add a "-h" option (like ls -h) that would display sizes in a "human-readable" format.
    [ Blog # A Programmer's Ride ]
    Linux: it really whips the penguin's butt.

  5. #5
    Join Date
    Apr 2006
    Location
    Hamilton, New Zealand
    Beans
    198
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Where's the source code?

    You can find top at sourceforge here: http://sourceforge.net/projects/unixtop/

  6. #6
    Join Date
    Feb 2007
    Beans
    4,045
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: Where's the source code?

    Code:
    $ which top              # To get the full path of the command
    /usr/bin/top
    $ dpkg -S /usr/bin/top   # Search for the package that installs that file
    procps: /usr/bin/top
    $ apt-get source procps  # Get the source

  7. #7
    Join Date
    Feb 2007
    Location
    Bucharest
    Beans
    460
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Re: Where's the source code?

    Wow, thanks for the tips everyone!
    [ Blog # A Programmer's Ride ]
    Linux: it really whips the penguin's butt.

  8. #8
    Join Date
    Apr 2005
    Beans
    849

    Re: Where's the source code?

    just out of curiosity what do you want to add to top?

    I think /proc/meminfo is the base of every other memory monitor program on linux.
    The same with /proc/cpuinfo
    Running 8.10 on a lenovo 3000 n200!
    Fingerprint reader doesn't work.

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •