Skip to content

Latest commit

 

History

History
78 lines (50 loc) · 2.44 KB

README.md

File metadata and controls

78 lines (50 loc) · 2.44 KB

📄 Csync

Csync offers an easy CLI to share your clipboard between different devices. This is done through network, you should prepare a server that all your devices can access it.

Csync is written by Rust, it is very fast and lightweight!


Installation

Download from release

You can find all binary files from GitHub Release Page.

Use Cargo to install it

cargo install --git https://github.com/fioncat/csync

Usage

Prepare a server

You need to prepare a server that all devices can access to perform data exchange. Run the following command in your server:

csync serve --bind "<bind-addr>" --password "<your-password>"

Arguments:

  • --bind: The server bind address, default is 0.0.0.0:7703.
  • --password: All data will be encrypted using AES. Your clipboard data will be safety exchanged in network. The client should configure the same password otherwise it won't be able to send or receive data from server.

Sync clipboard in device

Add a csync config file ~/.config/csync.toml:

# ~/.config/csync.toml

addr = "<server-add>"        # The server address
password = "<your-password>" # The server password

download_dir = "<download-dir>"  # Download directory, default is ~/csync

client_interval = 300     # Listen server interval, ms
clipboard_interval = 300  # Listen clipboard interval, ms

Run the following command to start syncing:

csync start

You can manually send something to other devices:

csync send "Some text"
csync send -f /path/to/file

Special thanks

  • tokio: The basic async runtime and network framework.
  • tokio-miniredis: I referd to its tcp stream IO logic and protocol implement.
  • arboard: Although I use external programs to interact with clipboard, but arboard is still a good cross-platform library to call clipboard using Rust. But sadly it does not support Wayland natively.
  • clipboard-master: Together with arboard, this is usually used to monitor clipboard events. But I still did not use this in csync since it does not support Wayland natively.

TODOList

  • Better docs
  • Support Windows
  • Better image support