Thursday, 29 October 2009

Slowly moving to DeviantArt

Well, after searching long and hard for somewhere that would host all of my scripts, etc., I have finally settled on DeviantArt. I have moved away from because (a) I don't actually use Gnome anymore, so it seems a little silly to ringfence myself in that way, (b) doesn't allow me to upload full-size screenies, which means I have to resize everything before uploading (read: what a pain!) and (c) ooooh, aren't the colours on the DevArt website purty?

So anyway, you can see my new profile here, and as a tasty taster, here's a screenie of my first upload, an Openbox theme for use with Espresso GTK theme, by SpecKtacle, over on

From My Little Desktop Photos

Monday, 26 October 2009

Argh. My first snag with my lovely Lua/Cairo!

So I've been working on making a lovely little eye-candy calendar widget to display with my Conky Widgets script, but I ran into a snag...Here's the best version I got before giving up (for now!):
From My Little Desktop Photos
Can you spot the annoyingness yet?

The text is misaligned!

As it turns out, Cairo draws text from an anchor point roughly at the lower left corner of the text being displayed. In this code, the month name/year, days of the week and day numbers are all evenly spaced on a square grid, but they look uneven because they are anchored at that lower-left position.

What I really want is for each element to be centered in a block. So the month/year is centered in a block that spans the top of the widget, and each of the day numbers is centered in a small square, like on a printed calendar.

However, in Cairo, you can't change where a text element is anchored, but you CAN use a function called cairo_text_extents() to give you some size information about the text block you want to manipulate, and then move to an appropriate start point. (See the Cairo tutorial for a more detailed explanation.)

I must have spent hours trying to get this function to work before I finally gave in and asked the Conky devs...and got this response: "tolua++ doesn't export any creation functions (or constructors) for C structures, only C++ classes." Basically, the third argument in the cairo_text_extents() function is of the structure cairo_text_extents_t, which isn't recognised by Lua.

All this roughly translated: as it stands now, we can't do any sophisticated text manipulation using Cairo in Lua. Booooo.

So the calendar is going to one side for the time being. Incidentally, if you would like to grab the Lua code for this widget, here you go.

Saturday, 17 October 2009

Finally! CPU temps in Conky on the Acer Aspire One!


I gave up on getting CPU temps in Conky (on my Acer Aspire One netbook) ages ago. Something to do with hardware incompatibility with lm-sensors, or acpi or something...Anyway, I never figured it out.

But after trawling through the Crunchbang forums in search of why I couldn't manage to compile the acerhdf module...I discovered how to find my CPU temp! Once I got acerhdf to compile (it turns out that I hadn't installed the headers for my Linux kernel, so the make was crashing out), I followed the instructions on this post to display the current CPU temp.

All you have to do is type
cat /sys/class/thermal/thermal_zone0/temp
in a terminal, and it outputs the CPU temp in degrees C.

To use this in Conky, just use
${exec cat /sys/class/thermal/thermal_zone0/temp}

Happy Conkying!

Thursday, 15 October 2009

A quick explanation to the Conky packages in Ubuntu 9.10 Karmic Koala

Hi all...

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! I thought I'd give you a quick guide, so you know which one to use so you get the most out of your favourite desktop monitor.

First of all: why are there so many versions now? It does seem a little excessive! However, according to Cesare Tirabassi, the Ubuntu maintainer for Conky, "One package was really not adequate anymore to satisfy the needs of all conky users. Some users want to have as many features as possible enabled, others as little as possible, some others are happy with what is enabled by default upstream. I therefore changed the packaging for karmic: now we have 3 possible flavours of conky available." (Those three flavours are represented by four packages in the repos, one of which will eventually be deprecated.)

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. From Cesare: "Its there to avoid that people upgrade and end up with things not working anymore. Users upgrading from previous versions of Ubuntu will be upgraded to the conky-all package via this transitional package; in fact this package does nothing, it only installs the conky-all package and it can be safely removed after upgrading.")

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.

Thursday, 1 October 2009

If you haven't tried Lua/Cairo yet, you're missing out!

Wow. So, it's been a while, huh? Well, don't you worry, I've been busy. I started teaching myself Lua, so I could do some scripting with the new Cairo bindings.

I've done a little Getting Started Guide over at the Conky Blog, and I've done some scripts, which are posted over at Conky Hardcore. If you haven't tried it yet, I HIGHLY RECOMMEND IT!!! Here are some screenies to whet your appetite :)
From Screenshots
From Screenshots
From Screenshots
From Screenshots
...All done with Conky, and only Conky :)