Giter VIP home page Giter VIP logo

cloud-clipboard's Introduction

cloud-clipboard

https://clipboard.yusanshi.com

Sync your clipboard across devices.

  • Support clipboard (text/image) and file.
  • Don't need to be within the same LAN (at the cost of additional online database).
  • Multiple clients: webpage/iOS/Linux/Windows.

DEMO

Clipboard: text

Copy text to clipboard on PC and paste on iPhone, and then reverse the process.

clipboard-text.mp4

Clipboard: image

Copy an image to clipboard on PC and paste on iPhone, and then reverse the process.

clipboard-image.mp4

File

Upload a file from PC and download to iPhone, and then reverse the process.

file.mp4

Database

This project uses Redis as the database and the HTTP interface provided by webdis. These info are needed:

  • host: the address of webdis.
  • prefix: used to isolate difference space.
  • username and password (optional, but strongly recommended): used for HTTP Basic Auth.

This project comes with a public webdis instance for testing. It is (1) not secure, (2) slow. You should always create your own webdis database before real usage.

Supported clients

Clipboard: text/plain Clipboard: image/png Clipboard: image/jpeg Clipboard: image/heic, image/heif File (of any type)
webpage 1
iOS Shortcuts 2
Linux Desktop
Windows 3

webpage: index.html

https://clipboard.yusanshi.com

The Redis info can be set at the bottom of the webpage. These info are saved in localStorage so you only need to input it once for each device.

We use Redis PUB/SUB to notify the changes, so you don't need to refresh the pages to get the latest status.

The webpage should be usable for all platforms. But it requires you to open the webpage and click pulling or pushing buttons. To save some keystrokes, you can use the clients for specific platforms. For example, with the Linux/Windows client, you can bind keyboard shortcuts to "copying to cloud" and "pasting from cloud" and then copy or paste with only one hotkey stroke.

iOS Shortcuts

For clipboard

For file

You can add the first three shortcuts to home screen for quick use. The last one can be triggered when you "Share" something in Files or Photos APP.

image

Linux Desktop: linux.py

Tested on Ubuntu GNOME (X11).

First install some packages:

pip install requests fire
sudo apt install xclip xdotool # if you use APT as the package manager

You can then bind these commands to keyboard shortcuts:

  • Copy selected content (send Ctrl+C) and push to cloud clipboard: python /path/to/linux.py copy --host "https://example.com/" --prefix "prefix" --username "username" --password "password"
  • Pull from cloud clipboard and paste (send Ctrl+V): python /path/to/linux.py paste --host "https://example.com/" --prefix "prefix" --username "username" --password "password"

Windows: windows.py

Tested on Windows 11.

First install some packages:

pip install requests fire pyautogui Pillow pywin32

You can then bind these commands to keyboard shortcuts:

Note: (1) we use pythonw instead of python to suppress the window popping up. (2) AutoHotkey is recommended to bind the keyboard shortcuts.

  • Copy selected content (send Ctrl+C) and push to cloud clipboard: pythonw /path/to/windows.py copy --host "https://example.com/" --prefix "prefix" --username "username" --password "password"
  • Pull from cloud clipboard and paste (send Ctrl+V): pythonw /path/to/windows.py paste --host "https://example.com/" --prefix "prefix" --username "username" --password "password"

Footnotes

  1. Has been implemented in the code. But currently the implementations of the Clipboard API do not support image/jpeg.

  2. For iOS, the HEIC/HEIF images will be converted to JPG before being pushed to cloud.

  3. Due to technical limit, the alpha channel is removed and filled with white (#FFF).

cloud-clipboard's People

Contributors

yusanshi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.