Home

Awesome

Clipsync - Sync your Clipboard across machines automatically.

Description

clipsync monitors your Linux clipboard (and primary selection) and synchronizes them across multiple computers.

The program requires access to a Mosquitto (MQTT) broker to do its work. If no private MQTT broker is available, clipsync connects to a public broker and uses a randomly created channel name. The contents of your clipboard are encrypted to avoid any chances of eavesdropping.

Both the X clipboard (Ctrl-C/Ctrl-V) and primary X selection (select with the mouse, paste using middle mouse button) are synchronized, with the option to synchronize between the local clipboard and primary selection automatically.

Basic principle of operation

Pre-requisites

Downloading clipsync

  1. Download a binary for your platform directly on the releases page. Binaries use AppImage, so they should run without effort across Linux distributions.
  2. Make the binary executable with chmod 755 <appimage_name>.
  3. Copy the binary to /usr/local/bin with sudo cp <appimage_name> /usr/local/bin

Or, if you have go installed, just clone this repository (git clone https://github.com/marcopaganini/clipsync) and run make inside the repo root directory.

Running clipsync

Using the default MQTT server (no MQTT setup needed)

On your main workstation, just run clipsync client. Clipsync will create the initial random password and connect to the default MQTT broker. Note that clipsync will not put itself in the background automatically (more on that below).

To sync with other computers:

It's important to make sure that all computers have the same ~/.config/clipsync/crypt-password, or things won't work as expected.

If all you need is to sync your clipboard, you can safely skip the rest of this section.

Using a private MQTT server

For more complex configurations, it's possible to specify all configuration items directly on the command-line. However, this would make it easier for eavesdroppers (with access to your workstation) to see your user, password, and encryption password. The recommended way is to create a configuration file under your home directory:

mkdir -p ~/.config/clipsync

cat >~/.config/clipsync/config <<EOF
--user=your_user_on_the_remote_mqtt_broker
--server=ssl://your_mqtt_broker_url:<port>
--password-file=~/.config/clipsync/secret
--cryptpass-file=~/.config/clipsync/crypt-password
--redact-level=6
EOF

Remember that clipsync will generate a crypt-password file automatically the first time it runs, and this file must be identical on all computers that are synchronizing their clipboards.

Where:

Now, create the MQTT account password file:

echo "my_server_password" >~/.config/clipsync/secret

Obtaining an MQTT account

There are a few ways to go about an MQTT account:

Automating startup using systemd

The easiest way to run clipsync is by using a user systemd unit. This guarantees that the program will run automatically on login. To do that:

Tricks and tips

Caveats

Alternatives