termux-packages/packages/termux-api/termux-clipboard-set
Fredrik Fornwall 9228c43493 termux-api: Change termux-clipboard-set
Make termux-clipboard-set set the clipboard to the arguments if
given, and only take stdin as input if no arguments given.

Closes https://github.com/termux/termux-api/issues/8
2015-12-29 18:15:33 -05:00

10 lines
106 B
Bash
Executable File

#!/bin/sh
if [ $# = 0 ]; then
TEXT=`cat -`
else
TEXT="$@"
fi
@TERMUX_API@ Clipboard --es text "$TEXT"