mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-05-22 04:51:12 +02:00
add termux commands to clipboard.zsh
This commit is contained in:
parent
d848c94804
commit
a2bd19018b
1 changed files with 19 additions and 1 deletions
|
|
@ -30,6 +30,17 @@ function clipcopy() {
|
|||
else
|
||||
cat $file > /dev/clipboard
|
||||
fi
|
||||
elif [[ $OSTYPE == linux-android ]]; then
|
||||
if (( $+commands[termux-clipboard-set] )); then
|
||||
if [[ -z $file ]]; then
|
||||
termux-clipboard-set
|
||||
else
|
||||
cat "$file" | termux-clipboard-set
|
||||
fi
|
||||
else
|
||||
print "clipcopy: termux-api not installed: https://github.com/termux/termux-api-package" >&2
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
if (( $+commands[xclip] )); then
|
||||
if [[ -z $file ]]; then
|
||||
|
|
@ -73,13 +84,20 @@ function clippaste() {
|
|||
pbpaste
|
||||
elif [[ $OSTYPE == cygwin* ]]; then
|
||||
cat /dev/clipboard
|
||||
elif [[ $OSTYPE == linux-android ]]; then
|
||||
if (( $+commands[termux-clipboard-get] )); then
|
||||
termux-clipboard-get
|
||||
else
|
||||
print "clippaste: termux-api not installed: https://github.com/termux/termux-api-package" >&2
|
||||
return 1
|
||||
fi
|
||||
else
|
||||
if (( $+commands[xclip] )); then
|
||||
xclip -out -selection clipboard
|
||||
elif (( $+commands[xsel] )); then
|
||||
xsel --clipboard --output
|
||||
else
|
||||
print "clipcopy: Platform $OSTYPE not supported or xclip/xsel not installed" >&2
|
||||
print "clippaste: Platform $OSTYPE not supported or xclip/xsel not installed" >&2
|
||||
return 1
|
||||
fi
|
||||
fi
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue