From a1992c66ca859f04aa1db6db26d757bae9ce358d Mon Sep 17 00:00:00 2001 From: Ivan Malison Date: Thu, 9 Oct 2014 21:54:45 -0700 Subject: [PATCH] update remote clipboard. --- dotfiles/lib/shellrc/remote_clipboard.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dotfiles/lib/shellrc/remote_clipboard.sh b/dotfiles/lib/shellrc/remote_clipboard.sh index 55814664..b536af78 100644 --- a/dotfiles/lib/shellrc/remote_clipboard.sh +++ b/dotfiles/lib/shellrc/remote_clipboard.sh @@ -1,5 +1,7 @@ REMOTE_CLIPBOARD_PORT='1234' +alias rc_ssh="ssh -R ${REMOTE_CLIPBOARD_PORT}:localhost:1234" + function remote_clipboard_server() { while [ 1 ] do @@ -11,20 +13,20 @@ function remote_clipboard_server_daemon() { 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 } -function osx_nc_paste_to_remote_clipboard() { +function _osx_nc_paste_to_remote_clipboard() { nc localhost ${1-$REMOTE_CLIPBOARD_PORT} -D } function remote_os_copy() { if is_osx; then - osx_nc_paste_to_remote_clipboard + _osx_nc_paste_to_remote_clipboard else - linux_nc_paste_to_remote_clipboard + _linux_nc_paste_to_remote_clipboard fi }