termux-packages/packages/termux-api/termux-send-text
Fredrik Fornwall 59f0d218a6 Initial push
2015-06-13 01:03:31 +02:00

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