added pairdrop-cli to documentation

This commit is contained in:
schlagmichdoch 2023-02-22 02:22:51 +01:00
parent 3cb4e6d476
commit f8d49754d2
3 changed files with 59 additions and 14 deletions

View file

@ -47,11 +47,11 @@ Developed based on [Snapdrop](https://github.com/RobinLinus/snapdrop)
* On iOS and Android the devices share menu is opened instead of downloading the files * On iOS and Android the devices share menu is opened instead of downloading the files
* Multiple files are transferred at once with an overall progress indicator * Multiple files are transferred at once with an overall progress indicator
### Share Files Directly From Share / Context Menu ### Send Files or Text Directly From Share Menu, Context Menu or CLI
* [Share files directly from context menu on Windows](/docs/how-to.md#share-files-directly-from-context-menu-on-windows) * [Send files directly from context menu on Windows](/docs/how-to.md#send-files-directly-from-context-menu-on-windows)
* [Share directly from share menu on iOS](/docs/how-to.md#share-directly-from-share-menu-on-ios) * [Send directly from share menu on iOS](/docs/how-to.md#send-directly-from-share-menu-on-ios)
* [Share directly from share menu on Android](/docs/how-to.md#share-directly-from-share-menu-on-android) * [Send directly from share menu on Android](/docs/how-to.md#send-directly-from-share-menu-on-android)
* [Send directly via command-line interface](/docs/how-to.md#send-directly-via-command-line-interface)
### Other changes ### Other changes
* [Paste Mode](https://github.com/RobinLinus/snapdrop/pull/534) * [Paste Mode](https://github.com/RobinLinus/snapdrop/pull/534)

View file

@ -33,12 +33,16 @@ iOS Shortcuts to the win:
I created a simple iOS shortcut that takes your photos and saves them to your gallery: I created a simple iOS shortcut that takes your photos and saves them to your gallery:
https://routinehub.co/shortcut/13988/ https://routinehub.co/shortcut/13988/
### Is it possible to share files directly from the context / share menu? ### Is it possible to send files or text directly from the context or share menu?
Yes it finally is! Yes, it finally is!
* [Share files directly from context menu on Windows](/docs/how-to.md#share-files-directly-from-context-menu-on-windows) * [Send files directly from context menu on Windows](/docs/how-to.md#send-files-directly-from-context-menu-on-windows)
* [Share directly from share menu on iOS](/docs/how-to.md#share-directly-from-share-menu-on-ios) * [Send directly from share menu on iOS](/docs/how-to.md#send-directly-from-share-menu-on-ios)
* [Share directly from share menu on Android](/docs/how-to.md#share-directly-from-share-menu-on-android) * [Send directly from share menu on Android](/docs/how-to.md#send-directly-from-share-menu-on-android)
### Is it possible to send files or text directly via CLI?
Yes, it is!
* [Send directly from command-line interface](/docs/how-to.md#send-directly-via-command-line-interface)
### What about the connection? Is it a P2P-connection directly from device to device or is there any third-party-server? ### What about the connection? Is it a P2P-connection directly from device to device or is there any third-party-server?
It uses a P2P connection if WebRTC is supported by the browser. WebRTC needs a Signaling Server, but it is only used to establish a connection and is not involved in the file transfer. It uses a P2P connection if WebRTC is supported by the browser. WebRTC needs a Signaling Server, but it is only used to establish a connection and is not involved in the file transfer.

View file

@ -1,5 +1,5 @@
# How-To # How-To
## Share files directly from context menu on Windows ## Send files directly from context menu on Windows
### Registering to open files with PairDrop ### Registering to open files with PairDrop
The [File Handling API](https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/how-to/handle-files) is implemented The [File Handling API](https://learn.microsoft.com/en-us/microsoft-edge/progressive-web-apps-chromium/how-to/handle-files) is implemented
@ -25,17 +25,58 @@ Outstandingly, it is also possible to send multiple files to PairDrop via the co
[//]: # (Todo: add screenshots) [//]: # (Todo: add screenshots)
## Share directly from share menu on iOS ## Send directly from share menu on iOS
I created an iOS shortcut to send images, files, folder, URLs or text directly from the share-menu I created an iOS shortcut to send images, files, folder, URLs or text directly from the share-menu
https://routinehub.co/shortcut/13990/ https://routinehub.co/shortcut/13990/
[//]: # (Todo: add doku with screenshots) [//]: # (Todo: add doku with screenshots)
## Share directly from share menu on Android ## Send directly from share menu on Android
The [Web Share Target API](https://developer.mozilla.org/en-US/docs/Web/Manifest/share_target) is implemented but not yet tested. The [Web Share Target API](https://developer.mozilla.org/en-US/docs/Web/Manifest/share_target) is implemented but not yet tested.
When the PWA is installed, it should register itself to the share-menu of the device automatically. When the PWA is installed, it should register itself to the share-menu of the device automatically.
Please test this feature and create an issue if it does not work. This feature is still under development. Please test this feature and create an issue if it does not work.
## Send directly via command-line interface
Send files or text with PairDrop via command-line interface.
This opens PairDrop in the default browser where you can choose the receiver.
### Usage
```bash
$ pairdrop -h
Current domain: https://pairdrop.net/
Usage:
Open PairDrop: pairdrop
Send files: pairdrop file/directory
Send text: pairdrop -t "text"
Specify domain: pairdrop -d "https://pairdrop.net/"
Show this help text: pairdrop (-h|--help)
```
On Windows Command Prompt you need to use bash: `bash pairdrop -h`
### Setup
Download the bash file: [pairdrop-cli/pairdrop](/pairdrop-cli/pairdrop).
#### Linux
1. Put file in a preferred folder e.g. `/usr/local/bin`
2. Make sure the bash file is executable. Otherwise, use `chmod +x pairdrop`
3. Add absolute path of the folder to PATH variable to make `pairdrop` available globally by executing
`export PATH=$PATH:/opt/pairdrop-cli`
#### Mac
1. add bash file to `/usr/local/bin`
#### Windows
1. Put file in a preferred folder e.g. `C:\Users\Public\pairdrop-cli`
2. Search for and open `Edit environment variables for your account`
3. Click `Environment Variables...`
4. Under *System Variables* select `Path` and click *Edit...*
5. Click *New*, insert the preferred folder (`C:\Users\Public\pairdrop-cli`), click *OK* until all windows are closed
6. Reopen Command prompt window
[< Back](/README.md) [< Back](/README.md)