Sync your clipboard from host → target over SSH with minimal setup. Built for Ubuntu/Linux desktops using xclip.
Install deps:
sudo apt update
sudo apt install xclip openssh-server
sudo systemctl enable --now sshInstall the receiver (replace :1 with your actual DISPLAY):
./install.sh target --display :1If clipboard writes fail, allow your user to access the X11 display:
xhost +SI:localuser:$USERInstall deps:
sudo apt update
sudo apt install xclip openssh-clientInstall and connect (replace user@target-ip):
./install.sh host --target user@target-ip --gen-key --copy-idThis creates:
~/.local/bin/clip-sync~/.config/clip-sync/host.env
To run as a service (optional):
./install.sh host --target user@target-ip --install-serviceStart manually:
~/.local/bin/clip-sync runSend current clipboard once:
~/.local/bin/clip-sync send-onceOptional: notifications (host)
If notify-send is available, the host shows a notification when sync starts/stops.
Install it with:
sudo apt install libnotify-binIf the service is failing or you updated the scripts, reinstall everything on the host:
./install.sh host --target user@target-ip --reinstallHost config: ~/.config/clip-sync/host.env
Keys:
CLIP_TARGET(required):user@targetCLIP_IDENTITY: path to SSH key (leave empty to use default)CLIP_INTERVAL: poll interval in seconds (default0.5)CLIP_REMOTE_CMD: remote command to receive clipboard (default'$HOME/.local/bin/clip-receiver'). Keep$HOMEsingle-quoted in the config so it expands on the target.CLIP_HOST_DISPLAY: optional, set if systemd service lacks DISPLAYCLIP_XAUTHORITY: optional, set if systemd service lacks XAUTHORITY
Target config: ~/.config/clip-sync/target.env
Keys:
CLIP_DISPLAY: X11 display used by the target (example:1)
If the service starts but clipboard access fails, set these values in ~/.config/clip-sync/host.env:
CLIP_HOST_DISPLAY=":0"
CLIP_XAUTHORITY="$HOME/.Xauthority"Then restart the service:
systemctl --user restart clip-sync.serviceFor least privilege, you can restrict the target key in ~/.ssh/authorized_keys to only run the receiver script.
This utility uses X11 xclip. For Wayland, replace with wl-copy/wl-paste and update the scripts.