This is a read-only archive. Find the latest Linux articles, documentation, and answers at the new Linux.com!

Linux.com

Feature

CLI Magic: Lightweight Conky is a system monitor powerhouse

By Shashank Sharma on September 18, 2006 (8:00:00 AM)

Share    Print    Comments   

Conky is a lightweight system monitor that provides essential information in an easy-to-understand, highly customizable interface. The software is a fork of TORSMO, which is no longer maintained. Conky monitors your CPU usage, running processes, memory, and swap usage, and other system information, and displays the information as text or as a graph.

Debian and Fedora users can use apt-get and yum respectively to install Conky. A source tarball is also available.

Before you start the program, you need to have a .conkyrc file, which contains all the settings that control the behaviour and appearance of Conky. Extract conkyrc.sample from /usr/share/doc/conky to your home directory and rename it .conkyrc with a command like gunzip -c /usr/share/doc/conky/example/conkyrc.sample.gz > ~/.conkyrc.

To run Conky, type conky in a console and press Enter. Don't panic if you don't see anything -- Conky sets up its display in the root window. If you minimize all open windows, you'll find Conky sitting pretty on your desktop.

When run without any options, Conky draws itself on the lower left corner of the desktop. You can specify a position with the -a {top/bottom}_{right/left} switch; that is, to place Conky in the top-right corner, run conky -a top_right. You can additionally use -x and -y switches to specify X and Y coordinates on the screen along with -a option.

Several settings determine Conky's appearance. You can decide if you want Conky to have a border, a background color, a transparent window, and even what it displays. By default, Conky displays many things that you might not need. You can change what Conky displays by modifying the .conkyrc file.

The .conkyrc file has a simple format. The variables that determine Conky's behaviour are described first. The second part of the file begins with the line TEXT. Here you'll find a list of various items that Conky displays, such as CPU temperature, network traffic, and memory usage. To remove any item that Conky displays by default, you need to edit here. I removed these lines from my .conkyrc file because I didn't need a network traffic indicator:

${color lightgrey}Networking: Down:${color #8844ee} ${downspeed eth0} k/s${color lightgrey} ${offset 80}Up:${color #22ccff} ${upspeed eth0} k/s
${color #0000ff}${downspeedgraph eth0 32,150 ff0000 0000ff} ${color #22ccff}${upspeedgraph eth0 32,150 0000ff ff0000}

Before you make any changes to the file, save a backup with a command like cp .conkyrc .conkyrc_orig.

In addition to monitoring system information, you can use scripts with Conky to display non-system-specific information on your desktop, such as the weather in your area or the scores of a game. Many such scripts are listed along with a screenshot and respective .conkyrc file on the project's screenshots page. To make Conky run your script, you need to again edit the .conkyrc file, include the script with the $execi variable, and specify a periodic time interval that Conky should wait before executing the script again. You can read about $execi and other Conky variables on the project's descriptions page.

If you have a script to display live scores of a soccer match, you could include code like this at the end of the .conkyrc file:

${color magenta} Match score:
${color blue} ${execi time /location/to/script/score_script.sh}

Then, after every time seconds, Conky would execute the script, thus providing you with periodic reports.

Conclusion

Conky's ability to run custom scripts is one of its strengths, but running scripts requires resources, and you'll find these scripts can eat up most of your memory.

I have been using Conky for some time now and haven't found it to be missing any important features. But if you do, there's an active forum board and feature request table that might interest you.

Shashank Sharma is studying for a degree in computer science. He specializes in writing about free and open source software for new users.

Shashank Sharma specializes in writing about free and open source software for new users and moderates the Linux.com forum boards. He is the coauthor of Beginning Fedora, published by Apress.

Share    Print    Comments   

Comments

on CLI Magic: Lightweight Conky is a system monitor powerhouse

Note: Comments are owned by the poster. We are not responsible for their content.

collectd?

Posted by: Anonymous Coward on September 19, 2006 03:06 PM
For my (server) monitoring needs, finally found <a href="http://collectd.org/" title="collectd.org">collectd</a collectd.org> to be very convenient and dare I say, pleasant package. It's fast enough to run every 5 or 10 seconds, and provided CGIs usable enough to hand some rest to MRTG either.

#

Conky is cool!

Posted by: Anonymous Coward on September 19, 2006 03:03 AM
Conky is cool!
And so is root-tail!

#

secret word?

Posted by: Anonymous Coward on September 19, 2006 05:53 AM
Yeah, but does this Conky tell me what the secret word is each day?

#

Secret Word

Posted by: Anonymous Coward on September 19, 2006 10:06 AM
Sure! <a href="http://en.wikipedia.org/wiki/Conky_(Pee-wee's_Playhouse)" title="wikipedia.org">http://en.wikipedia.org/wiki/Conky_(Pee-wee's_Pla<nobr>y<wbr></nobr> house)</a wikipedia.org>

I quote:

Conky 2000, known affectionately as Conky, was an anthropomorphic robot, a friend of the Playhouse Gang on Pee-Wee's Playhouse, and was apparently pieced together by many parts of an electronic nature. One of Conky's primary functions was to provide Pee-Wee with the Secret Word for the day.

#

This story has been archived. Comments can no longer be posted.



 
Tableless layout Validate XHTML 1.0 Strict Validate CSS Powered by Xaraya