Using Conky - the Ultimate Linux System Monitor

Conky: The Light Weight but Powerful System Monitor for Linux

Mark Alexander Bain
If you're a Linux user and you want a system monitor then you really should consider using Conky. Conky is: lightweight;highly configurable with dozens of variables that can be displayed - such as the date, available memory, used memory, wireless connection status, battery status (on a laptop); it is easily customizable and able to display the output from your own custom scripts; able to display its output either in its own window or directly on the desktop; originally based on (the now unmaintained) Torsmo system monitor ; named after a character from the Canadian television series "Trailer Park Boys".

Given all of these advantages the obvious thing to do is to download Conky and try it out.

Installing Conky

You may want to download the latest version of Conky from sourceforge.net and then follow the instructions on Conky's documentation page to install it yourself, but in many Linux distributions this isn't necessary; if, for example, you have Debian, Suse or Ubuntu then log on as root (or use sudo) to run the command:

apt-get install conky
Or if you prefer you can use your disto's graphical interface to install Conky; for instance on Suse you may prefer to get Yast to do all of the hard work of installation for you. However, whichever way you prefer to use to install Conky the process is quick and easy, and in a very few minutes you'll be ready to run the application itself.

Starting Conky

Once you've gone through the installation process then next stage is to see what Conky looks like - and to do this you'll need to: start up an new console (such as Konsole or xterminal); type the work 'conky'. Conky should now open up in its own window, and you'll see that it displays such things as: the pc's name, operating system and parameters such as the system frequency; the amount of memory installed and how much of it is being used; how much of the CPU is being used and how many processes are being run; the status of the file system and the network;the top running processes.

However, the most exciting part comes when you start to configuring Conky to meet your own requirements.

Configuring Conky

When Conky starts it checks for two files: conkyrc - this is your personal configuration file, and lives in your home directory; conky.conf - Conky will only look for this if it can't find ~/.conkyrc and will be located somewhere like /etc/conky or /usr/local/etc/conky. The file ~/.conkyrc will not exist to start with, and so Conky will use conky.conf by default. You can, therefore, either copy conky.conf to ~/.conkyrc and then start modifying that, or you can create ~/.conkyrc from scratch - when you do that you must be aware of the fact that the file is divided into two sections: configuration and display.

The two sections must be separated by the TEXT key word, so that a simple ~/.conkyrc might contain:

alignment top_left
TEXT
CPU Usage: ${cpu}%
${color blue} ${top name 1} ${color red} ${top cpu 1} ${top mem 1}
${color blue} ${top name 2} ${color orange} ${top cpu 2} ${top mem 2}
${color blue} ${top name 3} ${color green} ${top cpu 3} ${top mem 3}
If you now restarted Conky then you'd see something like the following displayed on the top left of your desktop, and updating itself every couple of seconds:
CPU Usage: 4%
Xorg 2.65 8.67
firefox-bin 1.32 38.49
conky 0.66 1.28
You can find a complete list of the Conky variables and how to use them on the Conky web site, and it would be well worth while spending some time looking at the contents of the conky.conf file to see how the variables are used.

Customizing Conky

As well as the myriad of built in Conky variables that can be displayed on your desktop you can add custom information of your own - by making use of Conky's exec and execi variables - these both run any command that you want and then display the output, the only difference between them being that: exec runs the command whenever Conky updates; execi runs the command according to an interval that you set. If, for example, you wanted to check your Internet connection you could add:

${color white}
${execi 60 ping -c1 www.linuxtalk.co.uk}
Conclusion

We've seen that it's very easy to install, configure and customize Conky; and with the minimum of time and effort you can be up and running with a very light weight, but powerful, system monitor for Linux.

To comment, please sign in to your Yahoo! account, or sign up for a new account.