Skip to content

Commit 06b7c8d

Browse files
Update termux-bluetooth-connect
1 parent f073380 commit 06b7c8d

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

scripts/termux-bluetooth-connect

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,28 @@
1-
#!/data/data/com.termux/files/usr/bin/sh
1+
#!/data/data/com.termux/files/usr/bin/bash
22
set -e -u
33

44
SCRIPTNAME=termux-bluetooth-connect
55
show_usage () {
6-
echo "Usage: $SCRIPTNAME [string_uuid]"
7-
echo "Connect to the given uuid."
6+
echo "Usage: termux-bluetooth-connect [text]"
7+
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."
8+
echo " -h show this help"
9+
echo " -b set background color (default: gray)"
10+
echo " -c set text color (default: white)"
11+
echo " -g set position of toast: [top, middle, or bottom] (default: middle)"
12+
echo " -s only show the toast for a short while"
13+
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"
814
exit 0
915
}
1016

11-
while getopts :h option
17+
PARAMS=""
18+
while getopts :hsc:b:g: option
1219
do
1320
case "$option" in
1421
h) show_usage;;
22+
s) PARAMS=" --ez short true";;
23+
c) PARAMS+=" --es text_color $OPTARG";;
24+
b) PARAMS+=" --es background $OPTARG";;
25+
g) PARAMS+=" --es gravity $OPTARG";;
1526
?) echo "$SCRIPTNAME: illegal option -$OPTARG"; exit 1;
1627
esac
1728
done

0 commit comments

Comments
 (0)