mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-03-27 03:14:56 +01:00
adds clipboard plugin
this adds the copy and paste commands
This commit is contained in:
parent
0532860c61
commit
8003314493
1 changed files with 23 additions and 0 deletions
23
plugins/clipboard/clipboard.plugin.zsh
Normal file
23
plugins/clipboard/clipboard.plugin.zsh
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
# pbcopy is expected to be available on Mac OSX
|
||||
if type pbcopy &> /dev/null; then
|
||||
alias copy="pbcopy"
|
||||
alias paste="pbpaste"
|
||||
|
||||
# xsel is expected to be available on most modern XWindows based Linux distro
|
||||
elif type xsel &> /dev/null; then
|
||||
alias copy="xsel --clipboard --input"
|
||||
alias paste="xsel --clipboard --output"
|
||||
|
||||
# xclip is expected to be available on Linux distros that do not ship with xsel
|
||||
elif type xclip &> /dev/null; then
|
||||
alias copy="xclip --selection clipboard"
|
||||
alias paste="xclip --selection clipboard -o"
|
||||
|
||||
else
|
||||
echo 'No clipboard util found!'
|
||||
echo 'Please install one of the following utils:'
|
||||
echo '\tpbcopy'
|
||||
echo '\txsel'
|
||||
echo '\txclip'
|
||||
return 1
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue