literature

Conky Beginner Tutorial v2

Deviation Actions

AnonymousLink's avatar
Published:
18.7K Views

Literature Text

Ever since I've really started to use Linux as an OS, I've been using this wonderful application called Conky. This application monitors various things going on around your machine (disk space, processor usage, now playing, battery power left, processes running, network statistics, just to name a few) and draws the information retrieved directly to your desktop, meaning that it becomes part of the background (cool, eh? :D). Well, I'm going to give you a short intro into exactly what Conky is and what it can do.




First of all, conky is a package you can get from apt/aptitude/synaptic/pacman/. You install it using that, or if you really want to stay on top of the game (like me) you can download the source tarball from the SourceForge page, which is located here. I will also be providing all links at the bottom of this article for reference. :)


After installation, you can find the default configuration file under ~/.conkyrc, which is a hidden file in your home folder. Open that up using gedit, mousepad, nano, vi, or whatever editor suits your fancy. You'll then see a bunch of configuration variables that are a little confusing at first. We're gonna skip over those for now, and just pay attention to the part of the file that tells conky what to acutally display, which is located below the line "TEXT". This is where the fun begins.


Built-in variables are called with possible arguments by using the following format:  ${variablename}. Let's go over a few examples. The variable "nodename" displays your hostname (such as kittykatt-laptop or arch-desktop) and requires no arguments. When a variable needs no arguments, it can be called without the curly brackets like so:  $nodename. A variable that does require arguments is "cpu" (called using ${cpu}), which will display the percent usage of the cpu# specified.


A very nifty little variable is the exec variable. This allows conky to call external scripts. This is called in conky by using the following format:  ${exec /path/to/external/script}. execi is to perform the supplied command/script at a certain interval. Format for execi is "${execi (interval in seconds) /path/to/external/script}". The purpose of of execp is to call a command/script and parse it's output for conky variables. This is useful when inputting $color variables in the script itself. A common use for the exec variable that is most often used beside the nodename variable is ${exec whoami}, which will report your username. This can be used to report your "usernamehost" using the following format:  ${exec whoami}@${nodename}.


I've whipped up a quick and dirty sample conkyrc file for you guys to try out on your own just to see what a bare bones conky looks like. It shows just some of the basic information every conky should have and includes no external scripts. Just so you can see a little preview of it, here is a screenshot of when I used it on my own machine. The conkyrc includes the following information:


  • Computer Name, Kernel, and Uptime
  • Battery Power Info
  • Disk Space on HDD
  • RAM and Swap usage
  • Processor Usage
  • Network Statistics (including up and down)

And the .conkyrc for that configuration can be found hosted on my server as well (it's really long and I don't want to paste it here).


Once you get past the basic stuff, you can start REALLY having fun with this little application. There are a bunch of external scripts people have made JUST for conky. Some of the more notable ones are made by the user kaivalagi. These include the scripts conkyForecast, conkyEmail, conkyBanshe, conkyPidgin and several more. These can all be found in this thread on the Ubuntu forums. I've also made a few conky scripts of my own, including conkyDisks and conkyCal, both of which can be found in in my gallery. And if you're feeling really adventurous, you can start looking into loading LUA scripts into your conky configurations. This will give you some pretty fancy bars and graphs that are seen in most of the more advanced configs. More on Conky and LUA scripting can be found on the conky wiki.


I rework my conky config(s) almost daily and continue to upgrade/supplement them as I learn more and more uses for conky. To show you a little bit of what conky is capable of, here is a screenshot of one of my better conky setups that I've made. In that screenshot I'm using conky to report the following:  system information, processor usage, RAM and swap usage, battery power info, local repository status, top processes, network/connection statistics, HDD and mounted device space information, MPD now playing, calendar/clock combo, and one in the bottom right corner that displays what desktop I'm on currently and the name of said desktop. I'm actally calling four different instances of conky in that setup, each using a different config file. I just use a small Bash wrapper script that will call each conkyrc for me in one command.




Well, I've had fun writing this, and I hope you have a much better understanding now of what conky really is and what it can do. I also hope to see you whipping up your own conky configurations soon. ^^ If you have any conky questions, head on over to #conky on the FreeNode IRC network. Or stop by our network, SilverIRC, and ask shoot a few questions at yours truly. I'm far from knowing all of the answers, but I can usually answer most conky-related questions.


External Links:


Conky - Conky SourceForge page. All variables and config options are listed here in the documentation.
Sample Conky - Link to the sample conkyrc on my server that I talked about earlier.
CrunchBang Forums Conky Thread - Here's a link to the Conky thread on the CrunchBang forums. It's a great place to share your conky configurations and get a few new ideas from other users.

[ anonymouslink@deviantART.com ]



$ cat /etc/description
Conky Beginner's Tutorial. Goes over some basic stuff to introduce new users to the awesome application. Original copy of this tutorial by me located HERE.

If you have any suggestions on what could be added to this tutorial or how it could be improved, please let me know. :)

Update 07/02/2010: Added some more content about some of the more popular external scripts and adapted to dA not using inline images.


$ sh /usr/bin/disclaimer
Conky released under GPL




Comments16
Join the community to add your comment. Already a deviant? Log In
When I download conky it always saves as /file system/etc/conky. It does not save as the .conkyrc. I have been sitting at my comp for hours struggling to just get this software running. Can someone please offer some help?