termux-packages/packages/termux-api/termux-send-text

20 lines
385 B
Bash
Executable File

#!/system/bin/sh
if [ "$1" = "-h" -o "$1" = "--help" ]; then
echo "Usage: termux-send-text [TEXT]"
echo "Send text to the Android system as arguments or standard input"
exit
fi
DATA="$@"
if [ -z "$DATA" ]; then
DATA="`cat -`"
fi
unset LD_LIBRARY_PATH
am start --user 0 \
-a android.intent.action.SEND \
-t "text/plain" \
--es android.intent.extra.TEXT "$DATA" \
> /dev/null