aliases: clipboard: Add more aliases for xclip command
Also lint and cleanup the filepull/1773/head
parent
c268cd9abc
commit
9f66059f52
|
|
@ -1,20 +1,18 @@
|
||||||
cite 'about-alias'
|
cite 'about-alias'
|
||||||
about-alias 'pbcopy and pbpaste shortcuts to linux'
|
about-alias 'xclip shortcuts'
|
||||||
|
|
||||||
case $OSTYPE in
|
if _command_exists xclip; then
|
||||||
linux*)
|
alias pbcopy="xclip -selection clipboard"
|
||||||
XCLIP=$(command -v xclip)
|
alias pbpaste="xclip -selection clipboard -o"
|
||||||
[[ $XCLIP ]] && \
|
|
||||||
alias pbcopy="$XCLIP -selection clipboard" && \
|
|
||||||
alias pbpaste="$XCLIP -selection clipboard -o"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
|
|
||||||
|
alias xcpy="xclip -selection clipboard"
|
||||||
|
alias xpst="xclip -selection clipboard -o"
|
||||||
|
fi
|
||||||
# to use it just install xclip on your distribution and it would work like:
|
# to use it just install xclip on your distribution and it would work like:
|
||||||
# $ echo "hello" | pbcopy
|
# $ echo "hello" | xcpy
|
||||||
# $ pbpaste
|
# $ xpst
|
||||||
# hello
|
# hello
|
||||||
|
|
||||||
# very useful for things like:
|
# very useful for things like:
|
||||||
# cat ~/.ssh/id_rsa.pub | pbcopy
|
# cat ~/.ssh/id_rsa.pub | xcpy
|
||||||
# have fun!
|
# have fun!
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue