us ua ua

How to teach FreeBSD to tell the time.

 

Talking clock.

 

While writing an article about talking weather , I thought why not do the same with the clock.

Now our system can say the date and time, just by double-clicking on the shortcut that points to a simple script I have written.

The video below the article shows the work of the script , there I execute it several times so that you can see that this is not just reading text, but real time that changes with every minute.

Create an empty file with any name where you like, I created it in my home directory called date, that is, date.sh.

Then we make it executable with the command:

 

 

chmod a+x ~/date.sh

 

 

The date.sh file, or whatever you call it, should look like this:

 

 

#!/bin/sh

date +%A | tee > /tmp/date

date +%_d | tee >> /tmp/date

date +%B | tee >> /tmp/date

date +%Y. | tee >> /tmp/date

date +%k | tee >> /tmp/date

date +%M | tee >> /tmp/date

festival --tts /tmp/date

 

 

 

All the script is ready, let's create a shortcut on the desktop.

 

Create a file on the desktop called clock, time or whatever you like with the following content:

 

[Desktop Entry]

Version=1.0

Type=Application

Name=Часы

Comment=

Exec=/...../date.sh

Icon=/...../clock.png

Path=

Terminal=false

StartupNotify=false

 

 

 

The script requires the Festival speech synthesizer. We are reading one of my articles "Learning to Speak FreeBSD" if you do not have Festival speech synthesizer installed.