7 echo "usage: $SCRIPTNAME [OPTIONS] <output-file>"
9 echo "Take a photo and save it in a file. Valid options:"
10 echo " -c, --camera <camera-id> the id of the camera to use"
11 echo "See the termux-camera-info for getting information about available cameras"
16 O=`getopt -l camera: -l help -l size -- c:hs: "$@"`
20 -c|--camera) PARAM_CAMERA="--ei camera $2"; shift 2;;
21 -h|--help) show_usage; exit 0;;
22 -s|--size) PARAM_SIZE="--ei size_index $2"; shift 2;;
24 *) echo Error; exit 1;;
32 # Broadcasting: Intent { cmp=com.termux.extras/.SmsLister }
33 # Broadcast completed: result=13, data="http://fornwall.net"
34 OUTPUT=`LD_LIBRARY_PATH= am start --user 0 $PARAM_CAMERA $PARAM_SIZE --es file $FILE -n com.termux.extras/.PhotoActivity | grep result=1 | cut -d ' ' -f 4`
36 if [ $? != "0" ]; then
37 echo "ERROR: Failed, see logs"