Conky in Ubuntu 9.10 Karmic Koala
Normally I like to keep this blog as distro-neutral as possible, but since lots of you are finding your way here via Googling for info on Conky in Ubuntu 9.10, I thought it prudent to reprint my quick guide to the packages that you will find in the Karmic repos, as they have changed so significantly from previous repository versions, and may be a tad confusing...
If you currently use the Conky package from the Jaunty repos, you'll be on version 1.6.1. The latest release is now 1.7.2, and is available in the Karmic repos.
However, there are now four versions of Conky in the Karmic repos! The four versions now available are:
- conky
- conky-all
- conky-cli
- conky-std
(First, I should point out that conky and conky-all are actually the same install...conky is in reality just a metapackage that will install the conky-all package. It is there to protect users currently using the repo conky package from upgrading and having things break. The other two packages are options for those who want to have a lighter or minimal Conky install...Further explanation below.)
From the package documentation, here is a brief explanation of the differences between the packages:
conky-cli is a basic package that can be useful in servers or piped with dzen2.
It includes the following support:
MPD, MOC, math, apcupsd and I/O stats
conky-std should be a good compromise for most users that do not need special features.
It includes the following support:
X11, XDamage, XDBE, Xft, MPD, MOC, math, hddtemp, portmon, wireless, ALSA mixer, apcupsd, I/O stats and lua
conky-all includes almost all of the available support:
X11, XDamage, XDBE, Xft, MPD, MOC, math, hddtemp, portmon, RSS, curl, Weather (METAR and XOAP), wireless, IBM, nvidia, eve-online, Imlib2, ALSA mixer, apcupsd, I/O stats, Lua and Lua bindings for the cairo and imlib2 libraries
It is highly advised that you upgrade to one of these packages as soon as you can, as the conky metapackage will eventually be removed.
Please feel free to post a comment here if you need any further explanation!
Q & A with Conky’s Main Dev, Brenden Matthews
I've been working with Conky now for the better part of a year, which, I'll admit, makes me a bit of a latecomer to this game! This was my first ever screenshot, and my first foray into the wonder that is desktop customisation with Conky:
![]() |
| From Screenshots |
If you know me at all, I think you'd agree that I have since fallen deep in love with Conky, so when Conky's main developer, Brenden Matthews, agreed to answer a few questions for me, I jumped at the chance!
Q: How did Conky get started? I know that it was a "fork of Torsmo", but I'm not too familiar with Torsmo. Were you originally involved in that project? And if not, how did you come to inherit it and move it on to become Conky?
Brenden Matthews: Conky started when I created a patch for torsmo (to add data smoothing, i.e. sample averaging such as cpu_avg_samples) and received no feedback after submitting it. I also noticed a lack of activity with the project in general, and impulsively decided to fork the project. In some ways Conky hasn't changed much since torsmo, but it has evolved to something much more rich and more capable.
Q: How did you decide on the name Conky? I know it's named after that doll on Trailer Park Boys, but is that it, it just sounded cool? Or does it hold some special significance to you?
BM: I've been a big fan of the TV show for many years, and Conky was one of my favourite characters.
Q: How many developers are there now, and where are they located?
BM: There are a huge number of contributors to Conky. Many of them are one-off contributors, but the majority of the work is done by people who make regular contributions (and have done so for years). I don't want to list off anyone in particular for fear of leaving someone out, but if anyone is curious you can always check the git log (at http://git.omp.am/?p=conky.git;a=shortlog).
Q: How do you decide which features to add to Conky (e.g. an $rss variable as opposed to just letting people use $exec curl)?
BM: Things just sort of evolve. Usually I don't write many new features myself, as I have long since added all the stuff I had a personal interest in. Most of the work I do now is bug fixes and adding new patches (which usually requires a bit of tweaking). Often people submit patches which either duplicate efforts or are very similar to existing components, so I have to separate the parts that I want from those I don't.
For example, with the $curl object, we already had RSS support (which used curl) and later somebody added weather support (which also used curl). So, I refactored the code so that the curl, RSS, and weather parts were all separate components, and thus wound up with the $curl object.
Q: Which is your favourite feature in Conky?
BM: I really like the built in IMAP client with IDLE support. It's also probably one of the most under-utilized features of Conky (though I admit it can be tricky to set up). Then again, I might be biased, since I wrote all that code.
For a little background, see http://en.wikipedia.org/wiki/IMAP_IDLE
Q: What does the future of Conky look like? Or perhaps, what can we look forward to in Conky 2.0?
BM: Good question. There are some things about Conky I want to stay as they are, but some things need to change. For example, the current conkyrc syntax has to go, which probably won't make a lot of people happy (since their old configs won't work). I'm also quite happy about the Lua integration, but it still needs improvement. I want to expose more of the Conky internals via the Lua API, but this requires a bit of an internal Conky rewrite first. I'd also like to add some additional output and input options (i.e., drawing to multiple windows, receiving data from multiple remote Conky processes).
And of course, I'd like to add proper XRender support (which means proper transparency on composited X). Patches for this have been submitted already--I just haven't reviewed them yet. I need to stop slacking
The concept of a "Conky 2.0" has been around for a while (and I even began rewriting the code from scratch at one point), but there really isn't anything Conky doesn't already do that I want it to do.
Q: What do you do for a day job? Assuming it's not Conky!
BM: Conky as a day job would certainly be nice--but no, I have a normal job like everyone else. I work for a small wireless software/service company in Berkeley, California. I write code and drink coffee most of the day, and in my spare time I enjoy cycling (I happen to live car-free) and being outdoors in general.
Q: Some of us users out there have started to use the term "CCCC", for the "Creative Collaborative Conky Community". What do you think of that epithet?
BM: I think it's great that I've been a part of something that people find useful (and possibly entertaining). Some of my coworkers even use Conky--but I don't think they know I'm responsible for it. The fact that a community has sprung up around Conky is great and I hope that I can continue to make Conky suck less with every release.
Feature Feature: Imlib2 + Cairo Bindings for Lua
It's been great to see more and more of you starting to use Lua/Cairo in Conky! But did you know that you can use imlib2 bindings in Lua as well? You can combine Cairo drawing and imlib2 image manipulation to get display a photo album, for instance:

The screenshot above was made using Cairo to draw the frame, and imlib2 to draw the image. If you'd like to take a peek at the code, you can download it here: photo_album.lua.tar.gz.
If you'd like to get started using imlib2 in your Lua scripts, I'd offer you the same advice as for Cairo...
First, have a read through the relevant documentation. Then grab some code and start tweaking!
I'm really impressed with the way I've seen Conky users all over the web collaborate to come up with some really great Cairo-drawn images...Now hopefully you'll have a go at imlib2 as well...
Happy Conkying!
10,000 posts: Congrats to Ubuntu Forums’ Conky thread!
This is just a quick post to say congratulations to everyone over on the Conky thread at Ubuntu Forums: they ticked over their 10,000th post on Friday, 23rd October! It's one of the most active Conky threads I've ever seen (if not the most active EVER!) and took just three years and two days to get to 10,000 posts, an average of just under 10 posts a day.
Whilst the Ubuntu Forums thread has contributions from users of all distros, if you'd like to check out some other distro-specific Conky threads, here are a few to get you started:
If I've left out your favourite thread, post a link in the comments and let me know!
Widgets in Conky? It can be done!
If you haven't already jumped on the Conky 1.7.2 bandwagon, now may be the time to try it out...I've written a new script in Lua, that will allow you to draw widgets to your Conky window, a la this screenie:

The Conky above is a combination of four separate widgets (one clock and 4 semi-rings) in the Conky Widgets script, and all the text is written with Conky. You can download the Lua script and .conkyrc that made it here: conky_widgets.tar.gz.
This Conky Widgets script is essentially a "shell" to hold blocks of widget code, with the idea that you or anyone else can write blocks of code and call them simply in a single script, without having to make drastic changes to your script or to your Conky. To use it with your Conky, download the empty script here: conky_widgets.lua.tar.gz. Then download one or more code blocks: Air Clock (air_clock_wb.txt.tar.gz) or Ring Meter (ring_wb.txt.tar.gz). Simply copy the code block into the empty widget script, following the instructions in the script's header.
Finally, call your widgets with the following code before TEXT in your .conkyrc:
lua_load ~/scripts/conky_widgets.lua lua_draw_hook_pre widgets
Have a go and see what you can do! And if you write a widget code block yourself, please do post it here so we can all see what you've done.
(Don't have Conky 1.7.2 installed yet? Start here!)
Conky 1.7.2 Available in Ubuntu 9.10 Karmic Koala Repositories
Just for Ubuntu users: I've put together a quick guide to the Conky packages that will be available in the Ubuntu 9.10 Karmic Koala repositories. (The Karmic release is scheduled for 29 October, 2009.)
If you are interested, please check it out over on the Ubuntu Forums.
New Blog Feature: Screenshots!
This is just a quickie post to draw your attention to the newest feature of the blog: a compilation of screenshots! I'll be using it to showcase all the screenshots from the blog, all in one place, with reference back to the post from whence they came.
I hope that you will find the screenshot page to be a bit of inspiration!
To get there, simply click on the "Screenshots" button at the top of the page.
Happy Conkying!
Lua Cairo Bindings for Conky 1.7.2+…Getting Started
If you saw my last post about Lua Cairo bindings for Conky 1.7.2+, but didn't go any further with it, then you're not alone! It's pretty daunting at first, especially if you haven't programmed in Lua or Cairo before. Perhaps I can persuade you...?
The images in the following two screenshots use only Conky. They were written in Lua, using Cairo bindings:

If I've tickled your fancy, here are a few tips to get you started!
Before you start
First and foremost, grab yourself a copy of the latest Conky release. If you are running Ubuntu 9.04 or higher, you can get the .deb here. If you are running Ubuntu 9.10 Karmic Koala, version 1.7.2 is in the Karmic repos.
Read through the Cairo tutorial, and familiarise yourself with the Lua documentation. Not to say that you should do every exercise word-for-word or read every entry in the Lua reference manual, but it'll give you an idea of the kinds of things you can do, and where to find help if you need it.
Starting out
The easiest way to start is to modify someone else's work, just to get used to the syntax. Just find a script you like and start tweaking. Maybe change colours or shapes, placement of objects, or combine elements from different scripts. Try the following:
- Clock background by Norsetto
- Conky Pies by Brenden Matthews
- Air Clock or Rings, both by me
If you're ready to start making your own ideas come to life, have a go recreating the Cairo snippets on the Cairo website. Then start breaking out your own designs!
Working with Conky
There are a couple of bits you'll definitely need to get your Lua script to work with Conky. First, to define your Cairo surface:
if conky_window==nil then return end
local cs=cairo_xlib_surface_create(conky_window.display, conky_window.drawable, conky_window.visual, onky_window.width, conky_window.height)
cr=cairo_create(cs)
Next, the best bit: you can use the function conky_parse() to evaluate any Conky expression. For instance, you can use:
str=conky_parse('${cpu cpu0}')
to grab the total CPU percent usage of your system. It is saved as a string, so in order to get it as a numerical value, you will need to use:
value=tonumber(str)
conky_parse() and tonumber() together are a powerful combination, because it means that anything you can get in Conky, you can get in your Lua script.
And finally
Don't forget, if you come up with a new weird and wonderful way to use Conky, post it here!
Feature Feature: A simple desktop indicator using $desktop
If you don't use a desktop pager in a panel, it's useful to have it displayed on your desktop itself. Here's a quick guide to creating a simple desktop indicator in Conky, using a combination of $image and $desktop.
To give you an idea of what we're aiming for, here's a screenshot, with the desktop indicator in the top right:
The first thing to do is to create two simple images in GIMP or similar program. You'll need one semi-transparent black square (I used 75% transparency) and one opaque white square. You can make them as small as you like, because we'll use $image's -s flag to make them the right size in Conky (I made them 50x50px).
Step 2: Decide on the placement/layout of your desktop indicator boxes
As you can see from the example above, I use my four desktops in a line, but you may use them in a square or rectangle. You'll need to decide where to place all your squares. I did this in my head, but you may also choose to use graph paper to work it out. Conky places images using the top left corner as an anchor, so you'll be interested in the coordinates of that point for each of your squares. In my example above, the size of my Conky dictated that I placed my squares at (3,5) (47,5) (91,5) (135,5) -- starting at x=3, each square was 40px wide with 4px spacing between.
Step 3: Code your Conky!
First, draw all the black, semi-transparent squares:
${image ~/Pictures/bk_semi_trans_sq.png -p 3,5 -s 40x40}${image ~/Pictures/bk_semi_trans_sq.png -p 47,5 -s 40x40}${image ~/Pictures/bk_semi_trans_sq.png -p 91,5 -s 40x40}${image ~/Pictures/bk_semi_trans_sq.png -p 135,5 -s 40x40}
Then, use $if_match and $desktop to choose where to place the white square:
${if_match ${desktop}==1}${image ~/Pictures/wh_sq.png -p 3,5 -s 40x40}${endif}${if_match ${desktop}==2}${image ~/Pictures/wh_sq.png -p 47,5 -s 40x40}${endif}${if_match ${desktop}==3}${image ~/Pictures/wh_sq.png -p 91,5 -s 40x40}${endif}${if_match ${desktop}==4}${image ~/Pictures/wh_sq.png -p 135,5 -s 40x40}${endif}
Et voila! Enjoy your new desktop indicator!
A couple of notes:
You will need to adjust your update_interval config variable (e.g. before TEXT), depending on how responsive you want your indicator to be. I use 0.1.
This method will not work if you are running Compiz. That's because Compiz draws all of your "desktops" as virtual desktops all on one desktop. You will only ever appear to be on desktop 1! The example above was done running OpenBox as a desktop environment, with no compositing.
5 Great Sources of Conky Inspiration
So, I think we're all on the same page by now: Conky is a fantastic system monitor, but it can also be a nice little bit of eye-candy for your desktop. Once you've got a handle on the basics, you'll probably be looking for inspiration for your next great Conky config. Here are my top 5 favourite places to look, when I'm after ideas for a new Conky setup...
Browsing the Conky documentation may not seem particularly inspiring, but you'd be surprised! I've found some of my favourite variables just by reading through the variable list...Variables I would probably not have learned about any other way. For instance, it was here that I discovered the $scroll variable, which scrolls text inside a set number of characters. It was also here that I stumbled upon the $if_updatenr variable, which counts the number of updates and can display a different set of outputs for each one.
4. The Ubuntu Forums Conky Screenshot Thread
The biggest active thread I've found devoted to Conky, this baby boasts over 900 pages (at last count)...That's over nine THOUSAND posts of screenshots, hints, tips and troubleshooting. It's also frequented by some of the most prolific and best Conkyists out there, so you're dealing with the best of the best.
3. Conky Wiki
The Conky Wiki is where new releases are described in the most detail, with feature tours, screenshots and code snippets. It's the best place to browse the latest features and get ideas on how to implement them.
2. The Lifehacker Desktop Show and Tell Pool on Flickr
It's not all about Conky in this Flickr pool; it's a real mix of Mac OS, Linux distros and Windows. There are some absolutely awesome shots on here, from Conky to Rainmeter to Geektool to Samurize and beyond...If you want some real artistic inspiration, this is the place to look.
Hands down, the best place to look for Conky inspiration is Conky Hardcore! Captured from all over the 'net, Conky Hardcore! compiles the best and brightest ideas for Conky...and tells you how to achieve them on your own system. Whether you're a novice or an expert, Conky Hardcore! should definitely be in your bookmark list.
And finally...
So those are my top 5 resources for Conky inspiration...What are yours?



