Wednesday, February 10, 2010

Hot on the heels of my custom bars lua comes another script for drawing bars and rings. And after figuring out most of what goes into making a settings table work with cairo in a lua script... I decided to go with another approach.

Instead of setting up a settings table at the beginning of the script, then parsing the table with one function and feeding the parsed information into another function which converts the table values into local strings... I went with defining the values when calling the draw function. It maybe isn't as user friendly as the settings table way but in less than half the lines of my custom bars lua I have created a script that can generate the same bars and also generate ring meters.

Also I think the way that I have set up the code will make it easier to inset these meters into another Lua script. All it requires is that the meter drawing functions are placed above the function to be called in conky. Then you can use the functions with just a couple of setup lines.

Of course the ring meters are taken from londonali1010's ring meter script here. Many thanks to londonali1010 for all her excellent and inspirational work!

I have also enabled the addition of boundary rings for the ring meters. The outer and inner boundary rings can be set values for width, color and alpha individually.

The code in posted in the crunchbanglinux forum conky config thread here.
I have just updated the code to allow much easier use of rotation with the bars. Bars rotate in place and not relative to 0,0 in the new code.

No comments:

Post a Comment