Skip to content

Commit

Permalink
Update termux-bluetooth-connect
Browse files Browse the repository at this point in the history
  • Loading branch information
StevenSalazarM authored Jul 30, 2018
1 parent 06b7c8d commit 28e9732
Showing 1 changed file with 3 additions and 19 deletions.
22 changes: 3 additions & 19 deletions scripts/termux-bluetooth-connect
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,13 @@ set -e -u

SCRIPTNAME=termux-bluetooth-connect
show_usage () {
echo "Usage: termux-bluetooth-connect [text]"
echo "Show text in a Toast (a transient popup). The text to show is either supplied as arguments or read from stdin if no arguments are given."
echo " -h show this help"
echo " -b set background color (default: gray)"
echo " -c set text color (default: white)"
echo " -g set position of toast: [top, middle, or bottom] (default: middle)"
echo " -s only show the toast for a short while"
echo "NOTE: color can be a standard name (i.e. red) or 6 / 8 digit hex value (i.e. \"#FF0000\" or \"#FFFF0000\") where order is (AA)RRGGBB. Invalid color will revert to default value"
echo "Usage: termux-bluetooth-connect [device_uuid]"
echo "Connects to a given device and uuid"
exit 0
}

PARAMS=""
while getopts :hsc:b:g: option
do
case "$option" in
h) show_usage;;
s) PARAMS=" --ez short true";;
c) PARAMS+=" --es text_color $OPTARG";;
b) PARAMS+=" --es background $OPTARG";;
g) PARAMS+=" --es gravity $OPTARG";;
?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
esac
done

shift $(($OPTIND-1))

CMD="/data/data/com.termux/files/usr/libexec/termux-api BluetoothConnect $PARAMS"
Expand Down

0 comments on commit 28e9732

Please sign in to comment.