Cross-platform P2P solution for synchronizing text clipboard on a local network. The project may contain issues as it was created in a hurry, but no problems occurred during usage.
git clone https://github.com/nevergiveup-c/clipboard-sync.git
cd clipboard-sync
pip install -r requirements.txtCreate config.yaml in the project directory:
key: your-encryption-key-here
nodes:
pc1:
host: 192.168.1.10
port: 5555
pc2:
host: 192.168.1.11
port: 5555
laptop:
host: 192.168.1.20
port: 5555Generate key and configure:
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())"
# Copy the output and paste into config.yaml as the `key:` valueConfiguration parameters:
key- Encryption key for secure communicationnodes- List of all devices in your network- Node name (e.g.,
pc1,laptop) - any unique identifier host- IPv4 address of the device on local networkport- Any available port
- Node name (e.g.,
Run in foreground:
python main.py --node pc1 --config config.yaml --log INFORun as daemon (background):
python main.py --node pc1 --config config.yaml --log INFO --log-file --daemonStop daemon:
python main.py --node pc1 --daemon-kill| Option | Long Form | Description |
|---|---|---|
-n |
--node |
Node name from config (required) |
-c |
--config |
Path to configuration file (required for connections) |
-l |
--log |
Logging level (DEBUG, INFO, WARNING, ERROR) |
-lf |
--log-file |
Write logs to file. Use alone for default clipboard.log or specify path: --log-file path/to/file.log |
-d |
--daemon |
Run as background daemon |
-dk |
--daemon-kill |
Stop running daemon |
For 2 PCs on network 192.168.1.x:
PC1 (192.168.1.10):
python main.py --node pc1 --config config.yamlPC2 (192.168.1.11):
python main.py --node pc2 --config config.yaml- Python 3.7+