View Single Post
Posts: 968 | Thanked: 974 times | Joined on Nov 2008 @ Ohio
#441
@ rotoflex

Thought the idea of clock chimes interesting, so I wrote a script that will check the time and play the proper sound files. You just need to set 4 alarms each running the script at :00, :15, :30, :45.

Brute force, but it works. I didn't see an option in alarmed to run every 15 minutes, although somebody should be able to construct the proper cron syntax, which would get it down to 1 alarm.

Code:
#! /bin/bash

checkhour=`date +%H`
checkmin=`date +%M`
#echo $checkhour:$checkmin

if [ $checkmin -eq 00 ]; then
if [ $checkhour -eq 1 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord01-45db.wav
fi
if [ $checkhour -eq 2 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord02-45db.wav
fi
if [ $checkhour -eq 3 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord03-45db.wav
fi
if [ $checkhour -eq 4 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord04-45db.wav
fi
if [ $checkhour -eq 5 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord05-45db.wav
fi
if [ $checkhour -eq 6 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord06-45db.wav
fi
if [ $checkhour -eq 7 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord07-45db.wav
fi
if [ $checkhour -eq 8 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord08-45db.wav
fi
if [ $checkhour -eq 9 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord09-45db.wav
fi
if [ $checkhour -eq 10 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord10-45db.wav
fi
if [ $checkhour -eq 11 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord11-45db.wav
fi
if [ $checkhour -eq 12 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord12-45db.wav
fi
if [ $checkhour -eq 13 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour01-45db.wav
fi
if [ $checkhour -eq 14 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour02-45db.wav
fi
if [ $checkhour -eq 15 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour03-45db.wav
fi
if [ $checkhour -eq 16 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour04-45db.wav
fi
if [ $checkhour -eq 17 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour05-45db.wav
fi
if [ $checkhour -eq 18 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour06-45db.wav
fi
if [ $checkhour -eq 19 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour07-45db.wav
fi
if [ $checkhour -eq 20 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour08-45db.wav
fi
if [ $checkhour -eq 21 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour09-45db.wav
fi
if [ $checkhour -eq 22 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour10-45db.wav
fi
if [ $checkhour -eq 23 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour11-45db.wav
fi
if [ $checkhour -eq 0 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour12-45db.wav
fi
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtang1Q-45db.wav
fi
if [ $checkmin -eq 15 ]; then
if [ $checkhour -eq 1 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord01-45db.wav
fi
if [ $checkhour -eq 2 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord02-45db.wav
fi
if [ $checkhour -eq 3 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord03-45db.wav
fi
if [ $checkhour -eq 4 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord04-45db.wav
fi
if [ $checkhour -eq 5 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord05-45db.wav
fi
if [ $checkhour -eq 6 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord06-45db.wav
fi
if [ $checkhour -eq 7 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord07-45db.wav
fi
if [ $checkhour -eq 8 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord08-45db.wav
fi
if [ $checkhour -eq 9 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord09-45db.wav
fi
if [ $checkhour -eq 10 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord10-45db.wav
fi
if [ $checkhour -eq 11 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord11-45db.wav
fi
if [ $checkhour -eq 12 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord12-45db.wav
fi
if [ $checkhour -eq 13 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour01-45db.wav
fi
if [ $checkhour -eq 14 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour02-45db.wav
fi
if [ $checkhour -eq 15 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour03-45db.wav
fi
if [ $checkhour -eq 16 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour04-45db.wav
fi
if [ $checkhour -eq 17 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour05-45db.wav
fi
if [ $checkhour -eq 18 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour06-45db.wav
fi
if [ $checkhour -eq 19 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour07-45db.wav
fi
if [ $checkhour -eq 20 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour08-45db.wav
fi
if [ $checkhour -eq 21 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour09-45db.wav
fi
if [ $checkhour -eq 22 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour10-45db.wav
fi
if [ $checkhour -eq 23 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour11-45db.wav
fi
if [ $checkhour -eq 0 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour12-45db.wav
fi
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtang2Q-45db.wav
fi
if [ $checkmin -eq 30 ]; then
if [ $checkhour -eq 1 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord01-45db.wav
fi
if [ $checkhour -eq 2 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord02-45db.wav
fi
if [ $checkhour -eq 3 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord03-45db.wav
fi
if [ $checkhour -eq 4 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord04-45db.wav
fi
if [ $checkhour -eq 5 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord05-45db.wav
fi
if [ $checkhour -eq 6 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord06-45db.wav
fi
if [ $checkhour -eq 7 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord07-45db.wav
fi
if [ $checkhour -eq 8 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord08-45db.wav
fi
if [ $checkhour -eq 9 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord09-45db.wav
fi
if [ $checkhour -eq 10 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord10-45db.wav
fi
if [ $checkhour -eq 11 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord11-45db.wav
fi
if [ $checkhour -eq 12 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord12-45db.wav
fi
if [ $checkhour -eq 13 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour01-45db.wav
fi
if [ $checkhour -eq 14 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour02-45db.wav
fi
if [ $checkhour -eq 15 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour03-45db.wav
fi
if [ $checkhour -eq 16 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour04-45db.wav
fi
if [ $checkhour -eq 17 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour05-45db.wav
fi
if [ $checkhour -eq 18 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour06-45db.wav
fi
if [ $checkhour -eq 19 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour07-45db.wav
fi
if [ $checkhour -eq 20 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour08-45db.wav
fi
if [ $checkhour -eq 21 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour09-45db.wav
fi
if [ $checkhour -eq 22 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour10-45db.wav
fi
if [ $checkhour -eq 23 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour11-45db.wav
fi
if [ $checkhour -eq 0 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour12-45db.wav
fi
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtang3Q-45db.wav
fi
if [ $checkmin -eq 45 ]; then
if [ $checkhour -eq 1 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord01-45db.wav
fi
if [ $checkhour -eq 2 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord02-45db.wav
fi
if [ $checkhour -eq 3 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord03-45db.wav
fi
if [ $checkhour -eq 4 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord04-45db.wav
fi
if [ $checkhour -eq 5 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord05-45db.wav
fi
if [ $checkhour -eq 6 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord06-45db.wav
fi
if [ $checkhour -eq 7 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord07-45db.wav
fi
if [ $checkhour -eq 8 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord08-45db.wav
fi
if [ $checkhour -eq 9 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord09-45db.wav
fi
if [ $checkhour -eq 10 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord10-45db.wav
fi
if [ $checkhour -eq 11 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord11-45db.wav
fi
if [ $checkhour -eq 12 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tangstrikechord12-45db.wav
fi
if [ $checkhour -eq 13 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour01-45db.wav
fi
if [ $checkhour -eq 14 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour02-45db.wav
fi
if [ $checkhour -eq 15 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour03-45db.wav
fi
if [ $checkhour -eq 16 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour04-45db.wav
fi
if [ $checkhour -eq 17 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour05-45db.wav
fi
if [ $checkhour -eq 18 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour06-45db.wav
fi
if [ $checkhour -eq 19 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour07-45db.wav
fi
if [ $checkhour -eq 20 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour08-45db.wav
fi
if [ $checkhour -eq 21 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour09-45db.wav
fi
if [ $checkhour -eq 22 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour10-45db.wav
fi
if [ $checkhour -eq 23 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour11-45db.wav
fi
if [ $checkhour -eq 0 ]; then
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtangHour12-45db.wav
fi
play-sound /home/user/MyDocs/.sounds/ClockChimes/tingtang4Q-45db.wav
fi
That chimes the hour then the quarter hour. I modified the one I'm using to only chime the hour at the top of the hour, and only chime the quarters for the 15/30/45.
__________________
*Consumer*, not a developer! I apologize for any inconvenience.
My script to backup /home and /opt
Samsung Galaxy S Vibrant, Huawei S7, N900(retired), N800(retired)

Last edited by lemmyslender; 2011-03-16 at 17:29. Reason: typo in code
 

The Following User Says Thank You to lemmyslender For This Useful Post: