Skip to content

this tool syncs clipboard, texts, files & directories between my Windows-PC and Linux-Laptop using Hot Keys

Notifications You must be signed in to change notification settings

davoodya/Syncer

Repository files navigation

Clipboard Syncer (Windows ↔ Linux)

A simple Python-based clipboard sync tool between a Windows PC and a Linux laptop over the same network.

✨ Features

  • 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.
  • 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.

🧰 Requirements

Windows (Client)

  • Python 3.x
  • Modules:
    • pyperclip
    • keyboard

Linux (Server)

  • Python 3.x
  • Modules:
    • pyperclip
    • keyboard
  • Note: Linux side Must run with sudo due to keyboard requiring root access permission.

⚙️ Setup

0. Update IP addresses

  1. 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.
  1. 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.

1. Define Firewall Rules for TCP/65433

1.1: Using GUI

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

1.2: Using Powershell:

  1. Open PowerShell as Administrator
    • Press Win + S, search for PowerShell
    • Right-click and choose Run as Administrator
  2. Run the Following Command:
New-NetFirewallRule -DisplayName "Allow Clipboard Sync" `
                    -Direction Inbound `
                    -LocalPort 65433 `
                    -Protocol TCP `
                    -Action Allow
  1. Verify the Rule
    • Open Windows Defender Firewall with Advanced Security
    • Go to Inbound Rules
    • Look for the rule named "Allow Clipboard Sync"
  • 🛠 Notes

    • 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.

To Delete the Rule Later (Optional)

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.

2. Install Requirements

  • 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)

3. Run Script

  1. On Linux run Server side:
sudo python3 linux-server.py
  1. then On Windows open Powershell as Administrator and run Client:
python windows-client.py
  • Enjoy Script 😊

About

this tool syncs clipboard, texts, files & directories between my Windows-PC and Linux-Laptop using Hot Keys

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages