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 }