Merge pull request #448 from mimoralea/pbpaste-linux

Add aliases to copy to and paste from clipboard on the terminal for linu...
pull/450/head
Nils Winkler 2015-04-10 08:17:34 +02:00
commit f6a64d397f
1 changed files with 18 additions and 0 deletions

View File

@ -0,0 +1,18 @@
cite 'about-alias'
about-alias 'pbcopy and pbpaste shortcuts to linux'
case $OSTYPE in
linux*)
XCLIP=$(command -v xclip)
[[ $XCLIP ]] && alias pbcopy="$XCLIP -selection clipboard" && alias pbpaste="$XCLIP -selection clipboard -o"
;;
esac
# to use it just install xclip on your distribution and it would work like:
# $ echo "hello" | pbcopy
# $ pbpaste
# hello
# very useful for things like:
# cat ~/.ssh/id_rsa.pub | pbcopy
# have fun!