Send copy events over the network

Overview

Copiepate

Build Crates.io License

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.

Installation

Using Rust Cargo:

# On GNU+Linux you'll need xorg-dev libraries.
# On other OSes (MacOS and Windows) this step is unecessary.
sudo apt install xorg-dev libxcb-shape0-dev libxcb-xfixes0-dev

# Install copiepate (both server and client):
cargo install copiepate

Usage

On your local desktop start the daemon in server mode and forward the port 2323 using ssh:

# Start copiepate server and listen on 127.0.0.1:2323:
copiepate --server

# In another shell, forward the server port to a remote machine:
ssh remote-machine -R 2323:localhost:2323

On the remote machine, copiepate sends the content of stdin to the local machine clipboard:

# Set the clipboard content of the local machine:
echo -n "New clipboard content" | copiepate

Notes on security

In its default configuration, copiepate listens only on the localhost address, meaning that the port is not exposed to the local network.

WARNING: There is no authentication and encryption over the network other than the ssh tunnel. Meaning that any local process can write to the clipboard by knowing copiepate server port.

Vim integration

You can use copiepate to send the content of a vim register over the network:

" Using Plug as plugin manager:
Plug 'dimtion/copiepate', { 'rtp': 'vim' }

This plugin creates the following default bindings:

" Send the default register
noremap <leader>y :CopiePateReg<CR>

" In visual mode, send current selection
vnoremap <leader>y :CopiePate<CR>
You might also like...
stat-rs is a copy of linux command stat

stat-rs is a copy of linux command stat

Copy files from Git repository to local.

gitcp Copy files from Git repository to local. Install We are planning to add some installers support in the future. e.g. homebrew winget debian packa

Pure rust library for reading / writing DNG files providing access to the raw data in a zero-copy friendly way.

DNG-rs   A pure rust library for reading / writing DNG files providing access to the raw data in a zero-copy friendly way. Also containing code for re

Tool to copy things!

zp zp is a cli command to copy the contents of the source file or of the std output buffer to the clipboard. To use the zp, simply open your terminal

A crate to help you copy things into raw buffers without invoking spooky action at a distance (undefined behavior).

🗜 presser Utilities to help make copying data around into raw, possibly-uninitialized buffers easier and safer. presser can help you when copying dat

A CLI tool to copy-paste different Ipsums from your terminal

Lorem clipsum Explore the docs » View Demo · Report Bug · Request Feature Table of Contents About The Project Built With Usage Contributing Contact Ab

Just in time Oxidation. A little experimentation with inkwell and copy-and-patch compilation

Experimental Copy-and-Patch compiler backend written in Rust This is supposed to become an experimental compiler backend based on Copy and Patch to be

A procedural macro that copy-pastes match arms for new type variant enums.

All the same! If you ever had code that looks like this: use std::io; use std::pin::Pin; use std::task::{Context, Poll}; use tokio::io::AsyncWrite; us

 miniserve - a CLI tool to serve files and dirs over HTTP
miniserve - a CLI tool to serve files and dirs over HTTP

🌟 For when you really just want to serve some files over HTTP right now!

Comments
  • Fail to build copiepate

    Fail to build copiepate

    Hello, I'm trying to install your tool using cargo on debian, however the compilation fails:

    error[E0369]: binary operation `==` cannot be applied to type `proc_macro::Punct`
      --> /home/nimag42/.cargo/registry/src/github.com-1ecc6299db9ec823/time-macros-0.2.3/src/helpers/mod.rs:69:49
       |
    69 |         Some(TokenTree::Punct(punct)) if *punct == c => {
       |                                          ------ ^^ - char
       |                                          |
       |                                          proc_macro::Punct
    
    For more information about this error, try `rustc --explain E0369`.
    error: could not compile `time-macros` due to previous error
    warning: build failed, waiting for other jobs to finish...
    error: failed to compile `copiepate v0.1.0`, intermediate artifacts can be found at `/tmp/cargo-installlyq0hb`
    

    Here is my current version of cargo and lib:

    gorgeousPineapple ~ % cargo -V                                       
    cargo 1.56.0
    gorgeousPineapple ~ % apt-cache policy xorg-dev libxcb-shape0-dev libxcb-xfixes0-dev|grep Install -B1
    xorg-dev:               
      Installé : 1:7.7+23
    --
    libxcb-shape0-dev:
      Installé : 1.14-3
    --
    libxcb-xfixes0-dev:
      Installé : 1.14-3
    

    Do you need more information?

    Thanks,

    opened by nimag42 1
Owner
Loïc Carr
Loïc Carr
Send emails right from the terminal using Rust!

Send emails right from the terminal using Rust!

Dhravya Shah 7 Dec 21, 2022
Send files between machines - no installation required!

skicka.pwy.io:99 Skicka (from Swedish send) allows to send files between machines - no installation required! Transmitting a file is as easy as piping

Patryk Wychowaniec 55 Jul 12, 2023
Recollection Notify you for daily, weekly, monthly and yearly events

Recollection Notify you for daily, weekly, monthly and yearly events. Usage Use recollectctl to manage the events, and run recollectd daemon to monito

Kaiyang Wu 3 Jun 28, 2022
RedMaple offers an oppinionated yet extremely flexible data modeling system based on events for back-end applications.

RedMaple offers an oppinionated yet extremely flexible data modeling system based on events for back-end applications.

Amir Alesheikh 4 Mar 5, 2023
Leptos server signals synced through Server-Sent-Events (SSE)

Leptos Server Sent Events Server signals are leptos signals kept in sync with the server through server-sent-events (SSE). The signals are read-only o

messense 13 Oct 3, 2023
a search engine for your events!

event engine description event engine is a search engine for your events! too many websites and emails to keep track of? event engine takes care of th

Tao Tien 3 Apr 7, 2024
A CLI utility to secretly copy secrets to your clipboard. 🦀

seclip ?? ?? A CLI utility to secretly copy secrets to your clipboard. ?? Table of Contents Features Installation Usage Build From Source Contribution

Mufeed VH 34 Dec 27, 2022
Command-Line program that takes images and produces the copy of the image with a thin frame and palette made of the 10 most frequent colors.

paleatra v.0.0.1 Command-Line program that takes an image and produces the copy of the image with a thin frame and palette made of the 10 most frequen

Beka Modebadze 24 Dec 29, 2022
A trash-cli copy, but this time in Rust.

trash-rs A trash-cli copy, but this time in Rust. TODO Deletion Relative paths * functionality List files Include in Metadata: Original directory Date

null 1 Nov 23, 2021
Just a UNIX's cat copy, but less bloated and in Rust.

RAT The opposite of UNIX's cat, less bloated, and in Rust. About the project The idea of this CLI is "A CLI program that is basically UNIX's cat comma

Renan Fernandes 2 Mar 5, 2022