You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

27 lines
680 B

#!/bin/sh
10 years ago
set -e -u
show_usage () {
echo 'usage: termux-vibrate [-f,--force] [<duration_ms>]'
10 years ago
echo 'Vibrate the device for the specified duration (default:1000 ms).'
echo 'By default no vibration is done when in silent mode - use the'
echo '-f,--force option to force vibration even when in silent mode.'
10 years ago
exit 1
}
PARAM_DURATION=""
O=`getopt -l duration: -l force -l help -- d:fh "$@"`
10 years ago
eval set -- "$O"
while true; do
case "$1" in
-d|--duration) PARAM_DURATION="--ei duration_ms $2"; shift 2;;
-f|--force) PARAM_DURATION="--ez force true"; shift 1;;
10 years ago
-h|--help) show_usage;;
--) shift; break;;
*) echo Error; exit 1;;
esac
done
@TERMUX_API@ Vibrate $PARAM_DURATION