#!/bin/sh

VIBEFILE=/sys/class/leds/neo1973:vibrator/brightness

hour=`date +%l`
minute=`date +%M`

[ $hour -eq 0 ] && hour=12

if [ $minute -lt 15 ]; then quarter=4
elif [ $minute -lt 30 ]; then quarter=1
elif [ $minute -lt 45 ]; then quarter=2
else quarter=3
fi

for i in `seq $hour`
do
    echo 255 > "$VIBEFILE"
    # starting usleep takes longer than 20ms...
    #usleep 20000
    echo 0 > "$VIBEFILE"
    #usleep 20000
done

usleep 300000

for i in `seq $quarter`
do
    echo 255 > "$VIBEFILE"
    #usleep 20000
    echo 0 > "$VIBEFILE"
    #usleep 20000
done


