- Rust 98%
- Nix 2%
yank #
yank replicates the clipboard across your machines over a peer-to-peer
private mesh (using iroh), with no server in between.
All the machines connected to your mesh share the same clipboard: whatever was copied last, on any of them, is what every one of them pastes.
- Clipboard is shared almost instantly.
- Catches up with the latest copy when a machine is off, asleep or offline, and comes back.
- Support copying files
- Support for sharing secret with a lifetime (like copying from a password manager).
$ yank status
This machine 66a7e0c4ab0aa85615819f5257ad995e5b6f1cef3fc6e0bf412e818f7c8ea559
yank 0.2.0, up for 2h 14m
clipboard connected
Clipboard
ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIExample user@host — desktop, 41s ago
Machines
desktop connected direct [2a01:cb19:57:7500:a050:1baa:1f9a:c74c]:57148, 3ms, for 2h 13m
A yank mesh is meant only for machines you own and control. It gives access
and read though your clipboard at all time, so be carefull.
Sway, niri, Hyprland, KDE and most others Wayland compositors are supported. Tho, there is no X11, Gnome, or macOS support (more on that later). You can even add a machine with no graphical session to take part: it relays the latest copy between hosts that are not online at the same time, and serves the CLI.
Missing support (macOS, Gnome, and X11)
The project is still super early, and don't particularly need the support for those, so I did not invest time on it. If there is some demand, and some testers available I would gladly add it to the project.
Though, for Gnome some blockers exists. There is currently no interface a clipboard manager can use, as it does not implement the data-control protocol, and the clipboard portal extends remote-desktop sessions rather than standing on its own. To be fair, these protocols let any client read every clipboard change without asking (like we do) (see mutter#524). We would have to create a GNOME Shell extension to be able to plug to it, so it is not on my roadmap right now.
Installation #
yank is not distributed by any package manager yet. With cargo:
$ cargo install --git https://tangled.org/drawbu.dev/yank.git --locked
# OR
$ cargo install --git https://github.com/drawbu/yank.git --locked
$ yank service install
With Nix, the flake exposes a package, as well as a Home Manager module and NixOS module, that both add an enablable service.
Home Manager:
{
imports = [ inputs.yank.homeModules.default ];
services.yank = {
enable = true;
# Optional, to manage config.toml declaratively:
settings = { };
};
}
Usage #
To pair your machines, run this on one, and it will print you the command for the second host. Reminder: a paired machine has access to everything you copy, so be mindfull of which devices you give access. After that, the mesh is created and nothing else is needed.
$ yank peer add
Configuration lives in ~/.config/yank/config.toml, written with every
option commented out on first start. The daemon reads it once, so run
yank service restart after editing it.
Here are some useful commands. See yank help.
$ echo hi | yank copy # copy from a pipe, like wl-copy
$ yank copy -f ./photos # copy files, contents and all
$ yank paste # print the clipboard, for pipes
$ yank get # write the copied files here
$ yank clear # empty every machine's clipboard
$ yank copy --secret # gone everywhere in 90 seconds
Security and privacy #
yank uses the superb crate iroh, which establish direct connections between
endpoints, by find the best connection between them and maintaining them.
Connections are mutually authenticated with a per-machine Ed25519 key and
end-to-end encrypted.
See iroh's Security & Privacy.
Every paired machine is trusted with the whole mesh: it reads every copy, and the machines it pairs with or removes are paired or removed everywhere.
The latest non-secret copy and copied files are stored in
~/.local/state/yank in plain.
Contributing #
Contributions and bug reports are welcome and appreciated. Feature requests are welcome too, but may not be accepted: this project follows its maintainer's direction, and it cannot maintain every possible feature.
AI-generated code is welcome, but you must disclose it. You remain responsible for everything you submit. Undisclosed AI use or AI-written prose is slop and will be discarded immediately.
Acknowledgements #
jj-mesh gave me the idea of this
project through it use of iroh, and help to shape the direction.