From cc07ac1b268dad4e0b52869fcaeb5d41f31eb8cb Mon Sep 17 00:00:00 2001 From: Karan Gyan Date: Mon, 6 Apr 2026 18:04:22 +0530 Subject: [PATCH 1/2] fix: simplify single-item const group for gofmt -s, improve README diagram MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Replace const block with single const for pollInterval (gofmt -s compat) - Redesign ASCII diagram: wider boxes, port label, ⌘C/⌘V hints --- README.md | 14 ++++++++------ clipx/node.go | 4 +--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index 5fa668a..cebdb80 100644 --- a/README.md +++ b/README.md @@ -12,14 +12,16 @@ No cloud. No account. No Apple ID. No flaky Universal Clipboard. ## How it works ``` -┌─────────────┐ UDP unicast ┌─────────────┐ -│ MacBook │ ──────────────────► │ iMac │ -│ clipx │ │ clipx │ -│ 192.168.0.5 │ ◄────────────────── │ 192.168.0.6 │ -└─────────────┘ UDP unicast └─────────────┘ + ┌──────────────────┐ ┌──────────────────┐ + │ MacBook │ UDP :9877 │ iMac │ + │ │ ────────────────► │ │ + │ clipx │ │ clipx │ + │ 192.168.0.5 │ ◄──────────────── │ 192.168.0.6 │ + └──────────────────┘ └──────────────────┘ + copy ⌘C paste ⌘V ``` -Each Mac runs `clipx`. When you copy something, it sends the clipboard content directly to all paired peers via UDP. When it receives content from a peer, it writes it to your local clipboard. That's it. +Each Mac runs `clipx`. When you copy something, it sends the clipboard content directly to all paired peers via UDP unicast. When it receives content from a peer, it writes it to your local clipboard. That's it. - **UDP unicast** — reliable, fast, no firewall issues with multicast - **Explicit pairing** — `clipx pair `, no flaky auto-discovery diff --git a/clipx/node.go b/clipx/node.go index 4087b54..02f4a05 100644 --- a/clipx/node.go +++ b/clipx/node.go @@ -11,9 +11,7 @@ import ( "github.com/google/uuid" ) -const ( - pollInterval = 500 * time.Millisecond -) +const pollInterval = 500 * time.Millisecond // Node is a clipx daemon instance that watches the local clipboard, // broadcasts changes to peers, and applies incoming clipboard content. From c6cf2dc25c04ad6871e9525be259af9f761deb35 Mon Sep 17 00:00:00 2001 From: Karan Gyan Date: Mon, 6 Apr 2026 18:06:09 +0530 Subject: [PATCH 2/2] fix: align ASCII diagram boxes properly --- README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index cebdb80..472732a 100644 --- a/README.md +++ b/README.md @@ -12,13 +12,13 @@ No cloud. No account. No Apple ID. No flaky Universal Clipboard. ## How it works ``` - ┌──────────────────┐ ┌──────────────────┐ - │ MacBook │ UDP :9877 │ iMac │ - │ │ ────────────────► │ │ - │ clipx │ │ clipx │ - │ 192.168.0.5 │ ◄──────────────── │ 192.168.0.6 │ - └──────────────────┘ └──────────────────┘ - copy ⌘C paste ⌘V + ┌──────────────────┐ ┌──────────────────┐ + │ MacBook │ UDP :9877 │ iMac │ + │ │ ──────────────► │ │ + │ clipx │ │ clipx │ + │ 192.168.0.5 │ ◄────────────── │ 192.168.0.6 │ + └──────────────────┘ └──────────────────┘ + copy ⌘C paste ⌘V ``` Each Mac runs `clipx`. When you copy something, it sends the clipboard content directly to all paired peers via UDP unicast. When it receives content from a peer, it writes it to your local clipboard. That's it.