Some of my scripts for daily use on a linux desktop

Tuesday, January 19, 2010

Calendar wheel

Well, as I explore the conky a little bit deeper, I am very amazing of things we can draw with some lines of codes.
Last week I tried the Conky Contest of the Month with this "Calendar Wheel". We were only two guys to participate (too bad) but you can vote for my calendar if you like the conky I will now explain !! Edit: I won coool !

This script simply draw a circular calendar on the left side of the screen (I didn't try on the right side as text alignment is not easy with cairo).

The most difficult part of this script was to rotate the dates because cairo doesn't allow that: the trick was to draw each date on a separate image, rotate the image and then render the rotated image on the screen.
Customization can be done with colors, height and width and some text can be added (depending on the date) on the left side of the arc.

This is what I've done for the contest (and for learning myself Lua) !

After that, I added some improvements in version 1.1 :
- today's date can now be set anywere in the arc (not on only the horizontal line) : yoffset
- today's date can now have an offset (positive or negative) : xoffset
- the main thing is that the calendar is draw only at the start of the conky and when the date change (i.e. the calendar is saved in a PNG file and this is this file that will be displayed in the conky) or if the PNG file is deleted : so the conky become really really fast ...

And in version 1.2, the calendar can be drawn on the right side of the conky.

The script can be downloaded from ubuntu forums here.

Edit : how to set date in local language:
Here is what I've done for having dates according to my locale settings:
It your conkyrc, in the TEXT section, write
If you want to hide this date ,
use_xft yes
xftalpha 0
default_color 000000

It seems it works only for the black color .
I didn' manage to do that in Lua only

Happy Conkying !

More screenshots :

There is also a gallery on picasa

No comments:

Post a Comment