- Daemon Go ~150 lignes, zéro dépendance hors stdlib + toml - Watch clipboard local (poll 500ms, hash-based dedup) - Serveur HTTP POST /clip pour réception des pairs - Anti-boucle d'écho (lastHash + host+TS filtering) - Cross-platform: Linux (xclip/wl-paste), macOS, Windows - Configuration TOML statique des pairs - install.sh one-liner multi-OS - ARCHITECTURE.md + ROADMAP.md + README.md
79 lines
2.1 KiB
Markdown
79 lines
2.1 KiB
Markdown
# clip-sync
|
|
|
|
Clipboard bidirectional sync daemon for LAN. One binary, zero deps.
|
|
Copy on one machine → paste on another. Automatic, instant.
|
|
|
|
## One-liner install
|
|
|
|
```bash
|
|
curl -sSL https://git.dracodev.net/Projets/clip-sync/raw/branch/main/install.sh | bash
|
|
```
|
|
|
|
This detects your OS, downloads the right binary, and creates a default config.
|
|
|
|
## Quick start
|
|
|
|
1. Install on every machine with the one-liner above
|
|
2. Edit `~/.config/clip-sync/peers.toml` — add all your machines
|
|
3. Run `clip-sync` (or set up as a service)
|
|
|
|
```bash
|
|
clip-sync
|
|
# 2026/08/08 clip-sync: deepin listening on :9137, 3 peers
|
|
# 2026/08/08 recv: vivobook → 42 chars
|
|
```
|
|
|
|
## Config
|
|
|
|
```toml
|
|
# ~/.config/clip-sync/peers.toml
|
|
listen = ":9137"
|
|
|
|
[peers]
|
|
deepin = "192.168.30.101:9137"
|
|
vivobook = "192.168.20.161:9137"
|
|
openclaw1 = "192.168.30.27:9137"
|
|
```
|
|
|
|
## Service (optional)
|
|
|
|
### Linux (systemd --user)
|
|
```bash
|
|
mkdir -p ~/.config/systemd/user
|
|
curl -sSL https://git.dracodev.net/Projets/clip-sync/raw/branch/main/clip-sync.service -o ~/.config/systemd/user/clip-sync.service
|
|
systemctl --user enable --now clip-sync
|
|
```
|
|
|
|
### Windows (nssm)
|
|
```powershell
|
|
nssm install clip-sync C:\Users\bruno\bin\clip-sync.exe
|
|
nssm set clip-sync AppDirectory C:\Users\bruno\.config\clip-sync
|
|
nssm start clip-sync
|
|
```
|
|
|
|
## How it works
|
|
|
|
```
|
|
┌──────────────┐ POST /clip ┌──────────────┐
|
|
│ deepin │◄──────────────►│ vivobook │
|
|
│ :9137 │ {text, ts} │ :9137 │
|
|
│ │ │ │
|
|
│ poll 500ms │ │ poll 500ms │
|
|
│ xclip -o │ │ Get-Clip │
|
|
└──────────────┘ └──────────────┘
|
|
```
|
|
|
|
See [ARCHITECTURE.md](ARCHITECTURE.md) for details.
|
|
|
|
## Build from source
|
|
|
|
```bash
|
|
git clone https://git.dracodev.net/Projets/clip-sync.git
|
|
cd clip-sync
|
|
go build -o clip-sync .
|
|
|
|
# cross-compile
|
|
GOOS=windows GOARCH=amd64 go build -o clip-sync.exe .
|
|
GOOS=darwin GOARCH=amd64 go build -o clip-sync-darwin .
|
|
```
|