- ✨ Features
- 🧰 Requirements
- ⚙️ Setup
- 0. Update IP addresses
- 1. Define Firewall Rules for TCP/65433
- 1.1: Using GUI
- 1.2: Using Powershell:
- To Delete the Rule Later (Optional)
- 2. Install Requirements
- 3. Run Script
A simple Python-based clipboard sync tool between a Windows PC and a Linux laptop over the same network.
- Send copied text from Windows (using
Ctrl + Alt + C
) to Linux:- Text gets appended to
PCRecieved.txt
- Also copied last received text into the Linux clipboard.
- Text gets appended to
- Send clipboard content from Linux (using
Ctrl + Shift + V
) to Windows:- Text gets appended to
LinuxReceived.txt
- Also copied last received text into the Windows clipboard.
- Text gets appended to
- Python 3.x
- Modules:
pyperclip
keyboard
- Python 3.x
- Modules:
pyperclip
keyboard
- Note: Linux side Must run with
sudo
due tokeyboard
requiring root access permission.
- In
server-linux.py
(Linux), set the correct IP of your Windows PC:
WINDOWS_CLIENT_IP = "192.168.x.x"
- Note: Use
ipconfig
on Windows to find your correct IP address.
- in
client-windows.py
(Windows), set the correct IP of your Linux PC:
SERVER_IP = "192.168.x.x"
- Note: Use
ifconfig
on Linux to find your correct IP address.
To ensure your Linux server can send data to your Windows clipboard sync client, you need to allow incoming connections on a specific TCP port (e.g., 65433
) in Windows Firewall.
0. WIN+R => wf.msc => Inbound Rules => New Rule
1. Define Allow Rule for Port TCP/65433
- OR You Can use Powershell
- Open PowerShell as Administrator
- Press
Win + S
, search forPowerShell
- Right-click and choose Run as Administrator
- Press
- Run the Following Command:
New-NetFirewallRule -DisplayName "Allow Clipboard Sync" `
-Direction Inbound `
-LocalPort 65433 `
-Protocol TCP `
-Action Allow
- Verify the Rule
- Open Windows Defender Firewall with Advanced Security
- Go to Inbound Rules
- Look for the rule named "Allow Clipboard Sync"
-
- You can change
65433
to any other port number if needed — just make sure it matches your Python script. - Make sure your Windows machine has a private or trusted network profile.
- No restart is needed; the rule applies immediately.
- This rule only opens TCP traffic on port
65433
.
- You can change
If you want to remove this rule, run:
Remove-NetFirewallRule -DisplayName "Allow Clipboard Sync"
- By completing this step, your Windows system is ready to receive clipboard data from your Linux machine over the network.
- Install
Python 3.12
on both Windows and Linux - then on Windows open Powershell as Administrator:
python -m pip install pyperclip
python -m pip install keyboard
- and on Linux:
sudo pip install pyperclip
sudo pip install keyboard
- Note: keyboard need to install with root access(sudo)
- On Linux run Server side:
sudo python3 linux-server.py
- then On Windows open Powershell as Administrator and run Client:
python windows-client.py
- Enjoy Script 😊