Skip to content

Latest commit

 

History

History
253 lines (198 loc) · 10.5 KB

README_EN.md

File metadata and controls

253 lines (198 loc) · 10.5 KB

SyncClipboard

中文 | English

Contents

Features

  • Clipboard syncing, supporting text/image/file, client-server architecture. You can also use a WebDAV compatible netdisk as server.
  • Optimize image type clipboard:
    • Paste image to a textbox directly after copying a image file from file system, and vice versa.
    • Download the original file and copy it after copying a image in web browser. This is helpful for copying an animated image in browser. Web sites always prevent downloads from non-browser, so this feature isn't always usable.
    • Copy the transcoded temporary image file (jpg or gif) after copying a modern image file type (heic, webp, etc.).

Server

Standalone Server

SyncClipboard.Server is cross-platform, depends on ASP.NET Core 6.0. Run with:

dotnet /path/to/SyncClipboard.Server.dll --contentRoot ./

Content root folder is SyncClipboard.Server.dll's parent folder, there will be temporary folders created when running.
Port, username, password can be changed in appsettings.json.
Choosing a different content root folder is possible. Copy a new appsettings.json to the folder and run with:

dotnet /path/to/SyncClipboard.Server.dll --contentRoot /path/to/contentRoot

Username and password can be set by env variables. When env variables SYNCCLIPBOARD_USERNAME and SYNCCLIPBOARD_PASSWORD are both not empty, the two variables will be used as username and password.

Notes:

  • Default Username is admin, default Password is admin, default port is 5033.
  • Address to fill in client is http://ip(or domain name):port, nothing can be omitted.
  • Http is not encrypted, including username and password. A https reverse proxy is needed on public network.

Docker

docker run -d \
  --name=syncclipboard-server \
  -p 5033:5033 \
  -e SYNCCLIPBOARD_USERNAME=your_username \
  -e SYNCCLIPBOARD_PASSWORD=your_password \
  --restart unless-stopped \
  jericx/syncclipboard-server:latest

Docker Compose

Copy a docker-compose.yml file.

curl -sL https://github.com/Jeric-X/SyncClipboard/raw/master/src/SyncClipboard.Server/docker-compose.yml > docker-compose.yml

Change env variables SYNCCLIPBOARD_USERNAME and SYNCCLIPBOARD_PASSWORD in docker-compose.yml to your username and password, then run

docker compose up -d

Notes:

Arch Linux

You can install it directly from AUR (maintained by @devome):

paru -Sy syncclipboard-server

Then edit its configuration file /etc/syncclipboard/appsettings.json as needed; be sure to change the username and password. Once modified, start the service (it is highly recommended to configure a reverse proxy and enable HTTPS):

sudo systemctl enable --now syncclipboard.service

Desktop Client Built-in Server

Desktop client (Windows/Linux/macOS) has a built-in server, basically the same as standalone server but can be configured with GUI.

WebDAV Server

Tested server:

Client

Clipboard is auto-synced between desktop clients running on Windows/Linux/macOS.

Screenshots

Windows

Download the SyncClipboard.zip from Release Page.
After extracting, run SyncClipboard.exe.

Dependencies:

Notes:

  • Config files are saved in %AppData%\SyncClipboard\. Users can delete them manually.

Linux, macOS

Downloading page: SyncClipboard.Desktop

Notes:

  • File name with no-self-contained: .NET 6.0 Desktop runtime and ASP.NET Core 6.0 runtime are required.
  • File name with self-contained: should run with no dependencies.
  • Config files are saved in ~/.config/SyncClipboard/(Linux), ~/Library/Application Support/SyncClipboard/(macOS). Uninstaller won't delete them. Users can delete them manually.
  • Not suport upgrading directly with deb or rpm package. Delete old version first, then install the new version.
  • Linux: Hotkey is not supported on Wayland.
  • macOS: "SyncClipboard" is damaged, can't be opened. Use the following command in terminal: sudo xattr -d com.apple.quarantine /Applications/SyncClipboard.app
  • macOS: Hotkey requires Accessibility permission. After installing a new version, the permission should be re-granted.

Arch Linux

Arch Linux users can directly install from AUR:

paru -Sy syncclipboard-desktop

IOS

  • Sync manually, import this Shortcut
  • Sync Automatically, import this Shortcut. This shortcut keeps running in the background forever, you need to stop it manually. You can also change whether to send notifications and querying interval time manullay.

Android

Import this file, Change the UserName, UserToken, url in Variables to yours. Make sure no slash(/) at the end of url. HTTP Request Shortcuts supports using shortcuts from drop-down menu, home screen widgets, home screen icons and share sheet.

Screenshots

Import this js file. Change the user config. And set a running trigger, for example, running the script when Android system startup.

// START  User Config  
const url = 'http://192.168.5.194:5033'
const username = 'admin'
const token = 'admin'
const intervalTime = 3 * 1000                         // 3 seconds
const showToastNotification = true
// END    User Config  

Running in background, the script will download the remote text clipbaord automatically and set it to local clipboard. If satisfy any of the following conditions, upload is automatic.

Notes for Clients

There are three necessery config(maybe different words, same uses).

  • username
  • password
  • url, format is http://ip(or domain name):port. When using a WebDav server, url needs to be pointed to a specific existing folder as the working folder, like https://domain.com/dav/folder1/working%20folder. File name is the best not to contain any special characters or spaces, or you'll have to URL encode it. And do not use this folder to do anything else. If not using a desktop client(Windows/Linux/macOS), create a folder named file in the working folder to sync files. Desktop clients create this folder automatically. Make sure no slash(/) at the end of url.

API

Download/Upload Text

GET /SyncClipboard.json
PUT /SyncClipboard.json

Download/Upload File/Image

GET  /SyncClipboard.json
HEAD /file/filename         // optional
GET  /file/filename

PUT /file/filename
PUT /SyncClipboard.json

SyncClipboard.json

{
    "Type" : "Text"
    "Clipboard" : "Content",
    "File":""
}

{
    "Type": "Image", // or "File", "Group"
    "Clipboard": "hash, optional",
    "File": "filename"
}

Open Source Dependencies

Magick.NET
.NET Community Toolkit
H.NotifyIcon
WinUIEx
moq
Avalonia
FluentAvalonia.BreadcrumbBar
FluentAvalonia
Vanara
Tmds.DBus
SharpHook
DotNetZip.Semverd