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

20 lines
385 B
Plaintext
Raw Normal View History

2015-06-13 01:03:31 +02:00
#!/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