Split out the copy to clipboard functionality into its own function. It is universally useful.

This commit is contained in:
Simon Gomizelj 2011-11-30 09:24:40 -05:00
commit e733352ff1
2 changed files with 11 additions and 7 deletions

10
lib/clipboard.zsh Normal file
View file

@ -0,0 +1,10 @@
# function to send text to primary and secondary clipboards
sendtoclip() {
if (( $+commands[xclip] )); then
echo -n $@ | xclip -sel primary
echo -n $@ | xclip -sel clipboard
elif (( $+commands[xsel] )); then
echo -n $@ | xsel -ip # primary
echo -n $@ | xsel -ib # clipboard
fi
}