Browse Source

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
android-5
Fredrik Fornwall 9 years ago
parent
commit
9228c43493
  1. 2
      packages/termux-api/build.sh
  2. 7
      packages/termux-api/termux-clipboard-set

2
packages/termux-api/build.sh

@ -1,6 +1,6 @@
TERMUX_PKG_HOMEPAGE=http://termux.com/add-ons/api/
TERMUX_PKG_DESCRIPTION="Termux API commands"
TERMUX_PKG_VERSION=0.9
TERMUX_PKG_VERSION=0.10
termux_step_make_install () {
mkdir -p $TERMUX_PREFIX/bin

7
packages/termux-api/termux-clipboard-set

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

Loading…
Cancel
Save