update remote clipboard.

This commit is contained in:
Ivan Malison 2014-10-09 21:54:45 -07:00
parent 7d30040e5b
commit a1992c66ca

View File

@ -1,5 +1,7 @@
REMOTE_CLIPBOARD_PORT='1234' REMOTE_CLIPBOARD_PORT='1234'
alias rc_ssh="ssh -R ${REMOTE_CLIPBOARD_PORT}:localhost:1234"
function remote_clipboard_server() { function remote_clipboard_server() {
while [ 1 ] while [ 1 ]
do do
@ -11,20 +13,20 @@ function remote_clipboard_server_daemon() {
daemonize `which reattach-to-user-namespace` -l $SHELL -c "source ~/.zshrc; remote_clipboard_server" daemonize `which reattach-to-user-namespace` -l $SHELL -c "source ~/.zshrc; remote_clipboard_server"
} }
function linux_nc_paste_to_remote_clipboard() { function _linux_nc_paste_to_remote_clipboard() {
nc localhost ${1-$REMOTE_CLIPBOARD_PORT} -q 0 nc localhost ${1-$REMOTE_CLIPBOARD_PORT} -q 0
} }
function osx_nc_paste_to_remote_clipboard() { function _osx_nc_paste_to_remote_clipboard() {
nc localhost ${1-$REMOTE_CLIPBOARD_PORT} -D nc localhost ${1-$REMOTE_CLIPBOARD_PORT} -D
} }
function remote_os_copy() { function remote_os_copy() {
if is_osx; if is_osx;
then then
osx_nc_paste_to_remote_clipboard _osx_nc_paste_to_remote_clipboard
else else
linux_nc_paste_to_remote_clipboard _linux_nc_paste_to_remote_clipboard
fi fi
} }