LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Software (https://www.linuxquestions.org/questions/linux-software-2/)
-   -   Chime on the hour? (https://www.linuxquestions.org/questions/linux-software-2/chime-on-the-hour-376773/)

usaf_sp 10-25-2005 12:06 PM

Chime on the hour?
 
I know this is kinda silly, but does anyone know of an application that can cause the computer to play a sound on the hour? You know like a clock?

MensaWater 10-25-2005 12:30 PM

You use cron for scheduling.

You could do "crontab -e" to edit the cron file then add an entry like:

0 * * * * tput bel >/dev/console

The above tells cron to execute the command on every hour of every day.

"tput bel" sounds a beep and redirecting to the console makes it do the one on your PC.
You could redirect it to your terminal if not at the console but since this may not always be on or you may be on a different terminal each time this could be a problem.

You can also try it with audio sound files. Do "find / -name *.au" You can try doing a cat of one of those to your audio device for example:

0 * * * * cat /usr/java/jdk1.3.1_15/demo/applets/Animator/audio/8.au >/dev/audio

Before adding to crontab just try the command (without the 0 * * * *) at your command line.

Also it may be to short a sound for you. You could script it to do the sound multiple times to make it a little longer - for example:

Code:

#!/bin/bash
CNT=0
until [ $CNT -eq 5 ]
do tput bel >/dev/console
    CNT=`expr $CNT +1`
done

Would make it do the sound 5 times then stop.

thisbl3 02-24-2007 11:47 AM

I am wanting to do this also..I am useing damn small linux which I do not think has cron..or I can not find it..

I did install sox...could I use it rather than cat..ie sox/location of wav file/something ?..

.downloaded grandfatherclock via synaptic but it does not automatically chime on the hour although I did find the executable which when executed will chime the current hours...

I would prefer it only to chime once or twice rather than a chime for each hour..ie 11pm = 11bongs.
thanks for any help.


All times are GMT -5. The time now is 10:33 AM.