Created
June 19, 2012 19:49
-
-
Save meskarune/2956149 to your computer and use it in GitHub Desktop.
Tester Tocsin Program
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
# | |
#Tocsin - Plays a Chime at the Hour and Quarter Hour | |
# | |
# You can change the paths to any sound files you'd like, but paths must be absolute for cron to work | |
# This script uses mpg123 to play the mp3 chime files. Alternative programs would be aplay, ogg123, and madplay. | |
#Quarter Chime Variables | |
fifteen="/home/meskarune/GIT/tocsin/chimes/quarter1.mp3" | |
thirty="/home/meskarune/GIT/tocsin/chimes/quarter2.mp3" | |
fortyfive="/home/meskarune/GIT/tocsin/chimes/quarter3.mp3" | |
# Hour Variable | |
hour=`date +%I` | |
# Hour Chime Variable | |
hourchime="/home/meskarune/GIT/tocsin/chimes/$hour-hour.mp3" | |
# Chime the Hour when minutes = 00 and Quarter Hours on the 15, 30, | |
# and 45 minute marks. | |
case "$(date +%M)" in | |
00) | |
mpg123 -q $hourchime | |
;; | |
15) | |
mpg123 -q $fifteen | |
;; | |
30) | |
mpg123 -q $thirty | |
;; | |
45) | |
mpg123 -q $fortyfive | |
;; | |
esac |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
mplayer -softvol -volume 25 $hourchime