Copiepate is a small utility to remotely set the content of a clipboard.
I created this tool as I frequently use a remote tmux+vim setup and I often need to copy a vim register to my local desktop.
On your local desktop start the daemon in server mode and forward the port 2323 using ssh:
```bash
copiepate --server
ssh remote-machine -R 2323:localhost:2323 ```
On the remote machine, copiepate sends the content of stdin to the local machine clipboard: ```bash
echo -n "New clipboard content" | copiepate ```
Using Rust Cargo: ```bash
sudo apt install xorg-dev libxcb-shape0-dev libxcb-xfixes0-dev
cargo install copiepate
openssl rand -base64 32
mkdir -p ~/.config/copiepate
cat << EOF > ~/.config/copiepate/config.toml
secret = "
You can use copiepate to send the content of a vim register over the network:
vim
" Using Plug as plugin manager:
Plug 'dimtion/copiepate', { 'rtp': 'vim' }
This plugin creates the following default bindings:
```vim
" Send the default register
noremap
" In visual mode, send current selection
vnoremap
Copiepate supports having a configuration file to persist configuration. Every setting can either be stored in the config file or by a command line argument. Any setting set in the configuration file will be overriden by parameters passed to the command line.
See full list of settings running copiepate --help
.
```toml
address = "192.168.0.2"
port = "2325"
secret = "/f7NyvhS4k90gnstzXVPk/SpRl/Ex4EX9tyHRA2rT0w="
#
#
#
#
exec = "echo -en \"\007\""
#
tee = true ```
In its default configuration, copiepate listens only on the localhost address, meaning that the port is not exposed to the local network.
WARNING: copiepate use encryption to ensure that attackers can't send paste event or evedrop what messages are in transit over the network. However copiepate was not audited. I recommend to only listen on a localhost port and only forward the port using a secure protocol such as SSH, and not expose copiepate server to a local network or the internet.