I'm trying to make a script which transforms the current time into a clock image.
I'm doing it with imagemagick and bash. What I already have is a script which makes the clock from out nothing:
http://raymii.org/test/clock.sh
(It looks like:
http://raymii.org/test/clock.png )
But now the time has to be shown with hands.
What I was thinking is to call the script from a crontab every minute.
It then takes the current time with the date command, strips it so that the HHSS is left (with sed maybe). Then it makes a line with convert that is in the angle it should according to the current time(The Minute hand) and it does that also for the hour hand. Then it composites it all together.
I have a center dot, and the hands should come out of it. In the script I'm using percentages because the plan is to make it work at 1280x1024 and 1920x1280.
But the whole date to hand conversion part is to difficult for me. I totally do not know how to do that.
My bash skills are limited, and what I have can probably be done better, so i'd love some tips and suggestions. Especially for the time to hand part.