Erroneous Posted October 9, 2006 Share Posted October 9, 2006 I use mythtv. I use e17. Neither of which have a very good system for quickly seeing what time it is. Solution: have a voice tell you what time it is by pressing Alt+T, and date by pressing Alt+D. Here's how: copy this code to a file called time.sh: case "$1" in time) date "+ %l %M %p" | sed -e "s/00//g" | sed -e 's/ 0/ oh /g' | sed -e 's/AM/a-m/g' > .temp ;; date) date "+ %A, %B %dth" | sed "s/1th/1st/g" | sed "s/2th/2nd/g" | sed "s/3th/3rd/g" > .temp ;; *) date "+ %A, %B %dth" | sed "s/1th/1st/g" | sed "s/2th/2nd/g" | sed "s/3th/3rd/g" > .temp date "+ %l %M %p" | sed -e 's/ 0/ oh /g' | sed -e 's/AM/a-m/g' >> .temp ;; esac cat .temp flite .temp -o .temp.wav aplay -t wav .temp.wav &>/dev/null rm .temp rm .temp.wav Install the following: alsa-utils, flite. You want to have aplay or play commands, along with flite. Then add the appropiate lines to whatever keybinding configs you have for your window manager run "sh ~/time.sh time" and "sh ~/time.sh date" when you press Alt+T and Alt+D, respectively. Here's the lines for fluxbox: Mod1 t :ExecCommand sh ~/time.sh time Mod1 d :ExecCommand sh ~/time.sh date Restart/Reload your window manager and turn up your properly alsa-configured speakers to test it out. Quote Link to comment Share on other sites More sharing options...
PoyBoy Posted October 9, 2006 Share Posted October 9, 2006 Nice one. Put it in the wiki! Quote Link to comment Share on other sites More sharing options...
cooper Posted October 9, 2006 Share Posted October 9, 2006 I never did like the use of files for these types of tasks... case "$1" in SPEECH=""; time) SPEECH=$SPEECH `date "+ %l %M %p" | sed -e "s/00//g" | sed -e 's/ 0/ oh /g' | sed -e 's/AM/a-m/g'` ;; date) SPEECH=$SPEECH `date "+ %A, %B %dth" | sed "s/1th/1st/g" | sed "s/2th/2nd/g" | sed "s/3th/3rd/g"` ;; *) SPEECH=$SPEECH `date "+ %A, %B %dth" | sed "s/1th/1st/g" | sed "s/2th/2nd/g" | sed "s/3th/3rd/g"` SPEECH=$SPEECH `date "+ %l %M %p" | sed -e 's/ 0/ oh /g' | sed -e 's/AM/a-m/g'` ;; esac echo $(SPEECH) aoss flite -t $(SPEECH) play WARNING: Untested script! flite (which, I might add, is some truly shitty code. Not a comment in sight and fixed strings all over the place) only supports OSS. The aoss wrapping should enable playing in an ALSA environment. Remove if you're still using plain OSS. Quote Link to comment Share on other sites More sharing options...
Erroneous Posted October 9, 2006 Author Share Posted October 9, 2006 I didn't want to use files either but I was too lazy to read the man page for flite. If I put it in the wiki, I'll make sure to change it to festival too. Quote Link to comment Share on other sites More sharing options...
operat0r_001 Posted October 9, 2006 Share Posted October 9, 2006 Hahah the poo movie ... Quote Link to comment Share on other sites More sharing options...
stitch Posted October 9, 2006 Share Posted October 9, 2006 e17 deffinately has a clock module. you just have to be able to read an analog clock. otherwise thats a nice script Quote Link to comment Share on other sites More sharing options...
Erroneous Posted October 9, 2006 Author Share Posted October 9, 2006 Yeah, e17's analog clock is without dots, numbers, and is way too small. I put it on the wiki and it uses Festival and no files: http://www.hak5.org/wiki/TimeToSpeech Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.