|
old wall clock simulation March 09, 2015 03:44PM |
Registered: 12 years ago Posts: 49 |
#!/bin/bash
# d is current time in 0-12 format in my time zone to count strikes
# e is current time in 0-24 format to keep it quiet at night
# 1strike is edited sound of a short strike
# strikend is a strike with sustain and some gear sound at the end
# for the effect
# I do 1strike.mp3 (d -1) times in a loop and then strikeend.mp3 at the
# end
d=`TZ='YOUR TIME ZONE' date +%I`
e=`TZ='YOUR TIME ZONE' date +%H`
# added following to remove leading zero from date output like 09
let d=$(expr $d + 0)
let e=$(expr $e + 0)
if [ "$e" -lt 23 ] && [ "$e" -gt 7 ]
then
for (( c=1; c<d; c++ ))
do
mpg123 -q -f 120 /home/metric/clock/1strike.mp3
done
mpg123 -q -f 120 /home/metric/clock/strikeend.mp3
fi
|
Re: old wall clock simulation March 10, 2015 04:53PM |
Registered: 9 years ago Posts: 33 |
|
Re: old wall clock simulation March 11, 2015 03:26PM |
Registered: 9 years ago Posts: 1,037 |
|
Re: old wall clock simulation March 11, 2015 11:57PM |
Registered: 12 years ago Posts: 49 |
|
Re: old wall clock simulation March 12, 2015 12:37AM |
Admin Registered: 13 years ago Posts: 18,585 |