Skip to content

Instantly share code, notes, and snippets.

@Efreak Efreak/clip.sh
Created Aug 5, 2019

Embed
What would you like to do?
Termux clip command. Clipboard is set from piped text or from parameters, otherwise it displays the contents. WTFPL.
#!/usr/bin/env bash
if [ -t 0 -a $# -gt 0 ]; then
termux-clipboard-set "$@"
echo "$@"
elif [ -t 0 ]; then
termux-clipboard-get
else
p=`cat`
echo "$p" | termux-clipboard-set
echo "$p"
fi
exit
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.