Actually, this is just the prototype.
BellAqua's purpose is to announce aloud the hour on the hour, like some feature I heard on a friend's computer once. I hope to write a trivial GNOME Panel applet for this, which is definitely overkill. Here's the prototype though:
#!/bin/sh # by Richard Schwarting (aquarichygmail com); # 2009/07/10 # http://www.kosmokaryote.org function calc_period { CURMIN=`date '+%M'` CURSEC=`date '+%S'` # I should learn how to calc things in the shell properly export WAITSEC=`echo "(60 - ${CURMIN})*60 - ${CURSEC}" | bc` } echo `date` while true; do calc_period; echo "waiting ${WAITSEC} second until next hour"; sleep ${WAITSEC}; CURHOUR=`date '+%l'`; # it should be hard to arrive here *before* the hour # %k for 24-hour, %l for 12-hour spd-say "It is ${CURHOUR} o'clock"; echo `date`; done;
I'm not very good at bash shell scripting, so this could break a bunch of times, and might say the wrong hour, but I don't think it will (I reckon I'll probably over sleep instead! Or, at least I hope this programme is as lazy as me).
It's GPL2 of course.
To use it, save to a file, run with bash, and forget. You might consider setting it to run when you start, using System > Preferences > Startup Programmes (or whatever it's called in the English localisation) or however you like.
No comments:
Post a Comment