termux-packages/packages/termux-api/termux-vibrate
Fredrik Fornwall 59f0d218a6 Initial push
2015-06-13 01:03:31 +02:00

24 lines
463 B
Bash
Executable File

#!/system/bin/sh
set -e -u
show_usage () {
echo 'usage: termux-vibrate [<duration_ms>]'
echo 'Vibrate the device for the specified duration (default:1000 ms).'
exit 1
}
PARAM_DURATION=""
O=`getopt -l duration: -l help -- d:h "$@"`
eval set -- "$O"
while true; do
case "$1" in
-d|--duration) PARAM_DURATION="--ei duration_ms $2"; shift 2;;
-h|--help) show_usage;;
--) shift; break;;
*) echo Error; exit 1;;
esac
done
termux-api Vibrate $PARAM_DURATION