Forked from bketelsen/use lemonade for remote clipboard sharing
Created
July 19, 2022 05:34
-
-
Save aanari/e338488f708cfe2541cc0ab0e5d74969 to your computer and use it in GitHub Desktop.
how to use lemonade to share a clipboard between remote computers
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on local and remote machine: | |
go get github.com/pocke/lemonade (if you have Go installed, if not download lemonade binary from github) | |
make sure $GOPATH/bin is in your path on both machines | |
-- or move $GOPATH/bin/lemonade to a place already in your path like /usr/local/bin | |
on your local machine add a script like this: | |
cat ~/bin/remote | |
#!/bin/bash | |
ps cax | grep lemonade> /dev/null | |
if [ $? -eq 0 ]; then | |
echo "lemonade is running." | |
else | |
echo "lemonade is not running." | |
nohup lemonade server & | |
fi | |
ssh -R 2489:127.0.0.1:2489 remote.server.com | |
then chmod +x ~/bin/remote | |
when you type `remote` it will open lemonade server locally, ssh tunnel the lemonade clipboard port. | |
locally (like on my mac) cmd-C to copy something. | |
this works between any two computers, even if one of them is a vm on the same machine | |
remote - $> lemonade paste | |
OR use the amazing neovim which has built-in lemonade support and just type "p" in neovim to paste the contents | |
of your local clipboard to your remote neovim session buffer. | |
for bonus points, modify the script to use a variable to invoke it with the remote server name: | |
$ remote my.server.com |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment