Synchronizes the clipboard across multiple X11 and wayland instances running on the same machine.
To use clipboard sync, you only need to install it and start the service. It identifies and synchronizes your clipboards automatically.
Example use cases:
Table of Contents:
Install clipboard-sync with your system's package manager. If your system is not supported, please vote on the appropriate issue, or create one if it does not exist.
clipboard-sync is available in the Arch User Repository.
Install from the official repository:
sudo wget -P /etc/apt/sources.list.d/ https://raw.githubusercontent.com/dnut/deb/master/dnut.list
sudo apt update && sudo apt install clipboard-sync
If your system is not supported, you have two other options:
Build from Source, then install either system-wide or for only the current user:
sudo make install # system
make user-install # user
It can be easily uninstalled:
sudo make uninstall # system
make user-uninstall # user
clipboard-sync is published to crates.io, so it can be installed as a normal binary crate.
cargo install clipboard-sync
wget -P "$HOME/.config/systemd/user/" https://raw.githubusercontent.com/dnut/clipboard-sync/master/clipboard-sync.service
It can be easily uninstalled:
cargo uninstall clipboard-sync
rm -r "$HOME/.config/systemd/clipboard-sync.service"
In addition to installing from the official repository, you can also build and install the deb package from source. Follow the instructions to Build from Source, then create a deb file and install it with:
make deb && sudo apt install ./dist/deb/clipboard-sync_*.deb
Add this repo to your flake inputs:
clipboard-sync.url = "github:dnut/clipboard-sync";
Put clipboard-sync.nixosModules.default
into flake modules.
To enable the systemd service, add services.clipboard-sync.enable = true;
into the configuration.nix
.
The typical set-and-forget approach is to enable to service:
systemctl --user enable --now clipboard-sync
If you don't want it to run constantly, only on-demand, don't use systemd. Directly call the binary as needed:
clipboard-sync
You can also daemonize clipboard-sync using tmux instead of systemd. ~/.bashrc aliases may be handy for these commands.
tmux new-session -ds clipboard-sync clipboard-sync # start in background
tmux attach -t clipboard-sync # view status
ctrl-b, d # while viewing status, send back to background
ctrl-c # while viewing status, terminate the process
Ensure you have the build dependencies: rust make gcc libc libxcb
sudo pacman -Syu make gcc libxcb
sudo apt install make gcc libxcb1-dev libxcb-render0-dev libxcb-shape0-dev libxcb-xfixes0-dev
Download the source from the releases page and unzip it. Alternatively, select one of these commands to download the source:
wget -O- https://github.com/dnut/clipboard-sync/archive/refs/tags/0.2.0.tar.gz | tar xvz
curl -L https://github.com/dnut/clipboard-sync/archive/refs/tags/0.2.0.tar.gz | tar xvz
git clone https://github.com/dnut/clipboard-sync.git --branch stable
Compile the program
cd clipboard-sync*
make
The executable is here:
./target/release/clipboard-sync