feat(desktop): share dialog on Linux/macOS via cloudreve://share deeplink (#240)
* feat(desktop): share dialog on Linux/macOS via cloudreve://share deeplink The Explorer context menu is Windows-only; the share dialog itself is cross-platform but had no trigger elsewhere. cloudreve://share/<encoded local path> now routes through the same ManagerCommand::ShareLink pipeline, and desktop/linux/ ships a cloudreve-share helper plus Nautilus script and Dolphin service-menu glue so file managers can reach it. OAuth callback deeplinks are unaffected. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com> * fix(desktop): don't drop share deep links at startup Queue cloudreve://share/ links arriving before APP_STATE init and drain after the sync service is up; also scan argv for a cloudreve:// URL so a cold start launched by the file manager still opens the share dialog. Nautilus script now reads NAUTILUS_SCRIPT_SELECTED_FILE_PATHS per line so paths with spaces survive. * feat(desktop): macOS share helper + file-manager install docs cloudreve-share for macOS (open cloudreve://share/...) plus Shortcuts Quick Action recipe for Finder. READMEs document Nautilus, Dolphin, and Finder installation. --------- Co-authored-by: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>pull/3593/head
parent
de40dde4bd
commit
bb215ffd8b
@ -0,0 +1,35 @@
|
||||
# Linux file-manager integration
|
||||
|
||||
`cloudreve-share` opens the share dialog for a local path via the
|
||||
`cloudreve://share/<path>` deep link — the same dialog the Windows Explorer
|
||||
context menu opens. Works whether the app is running or not.
|
||||
|
||||
## Helper
|
||||
|
||||
```sh
|
||||
cp cloudreve-share ~/.local/bin/
|
||||
chmod +x ~/.local/bin/cloudreve-share
|
||||
cloudreve-share ~/Cloudreve/report.pdf
|
||||
```
|
||||
|
||||
## GNOME / Nautilus
|
||||
|
||||
```sh
|
||||
mkdir -p ~/.local/share/nautilus/scripts
|
||||
cp "nautilus/scripts/Cloudreve Share" ~/.local/share/nautilus/scripts/
|
||||
chmod +x ~/.local/share/nautilus/scripts/"Cloudreve Share"
|
||||
```
|
||||
|
||||
Right-click a file → **Scripts** → **Cloudreve Share**.
|
||||
|
||||
## KDE / Dolphin
|
||||
|
||||
```sh
|
||||
mkdir -p ~/.local/share/kio/servicemenus # Dolphin ≥ 22
|
||||
cp kde/cloudreve-share.desktop ~/.local/share/kio/servicemenus/
|
||||
```
|
||||
|
||||
Right-click a file → **Cloudreve** → **Share link…**. Restart Dolphin if the
|
||||
entry does not appear.
|
||||
|
||||
Requires `python3` and `xdg-open` (both standard on desktop Linux).
|
||||
@ -0,0 +1,16 @@
|
||||
#!/bin/sh
|
||||
# cloudreve-share — open the Cloudreve share dialog for local file(s).
|
||||
# Invoked by the Nautilus script and Dolphin service menu; also usable
|
||||
# directly: `cloudreve-share ~/CloudDrive/report.pdf`.
|
||||
#
|
||||
# Works whether the app is running or not — the packaged .desktop file
|
||||
# registers x-scheme-handler/cloudreve, and the app processes share deep
|
||||
# links passed on its own command line at cold start.
|
||||
# Requires python3 for URL encoding.
|
||||
|
||||
set -eu
|
||||
|
||||
for f in "$@"; do
|
||||
encoded=$(python3 -c 'import sys, urllib.parse; print(urllib.parse.quote(sys.argv[1]))' "$f")
|
||||
xdg-open "cloudreve://share/$encoded" &
|
||||
done
|
||||
@ -0,0 +1,15 @@
|
||||
# KDE Dolphin service menu — right-click > Cloudreve > Share link…
|
||||
# Install: copy to ~/.local/share/kio/servicemenus/ (Dolphin ≥ 22) or
|
||||
# ~/.local/share/kservices5/ServiceMenus/ (older), then restart Dolphin.
|
||||
# Requires `cloudreve-share` on PATH (see desktop/linux/cloudreve-share).
|
||||
|
||||
[Desktop Entry]
|
||||
Type=Service
|
||||
MimeType=all/all
|
||||
Actions=cloudreveShare
|
||||
X-KDE-Submenu=Cloudreve
|
||||
|
||||
[Desktop Action cloudreveShare]
|
||||
Name=Share link…
|
||||
Icon=emblem-shared
|
||||
Exec=cloudreve-share %f
|
||||
@ -0,0 +1,10 @@
|
||||
#!/bin/sh
|
||||
# Nautilus script — adds "Scripts > Cloudreve Share" to the right-click menu.
|
||||
# Install: copy to ~/.local/share/nautilus/scripts/ and chmod +x.
|
||||
# Requires `cloudreve-share` on PATH (see desktop/linux/cloudreve-share).
|
||||
|
||||
# NAUTILUS_SCRIPT_SELECTED_FILE_PATHS is newline-separated; read per line so
|
||||
# paths containing spaces survive.
|
||||
printf '%s\n' "$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS" | while IFS= read -r f; do
|
||||
[ -n "$f" ] && cloudreve-share "$f"
|
||||
done
|
||||
@ -0,0 +1,25 @@
|
||||
# macOS file-manager integration
|
||||
|
||||
`cloudreve-share` opens the share dialog for a local path via the
|
||||
`cloudreve://share/<path>` deep link — the same dialog the Windows Explorer
|
||||
context menu opens.
|
||||
|
||||
## Terminal
|
||||
|
||||
```sh
|
||||
cp cloudreve-share ~/.local/bin/ # or anywhere on PATH
|
||||
chmod +x ~/.local/bin/cloudreve-share
|
||||
cloudreve-share ~/Cloudreve/report.pdf
|
||||
```
|
||||
|
||||
## Finder Quick Action
|
||||
|
||||
1. Open **Shortcuts** → new shortcut.
|
||||
2. Add action **"Run Shell Script"**:
|
||||
- Shell: `zsh` (or `sh`), Input: **Shortcut Input**
|
||||
- Script: `cloudreve-share "$1"`
|
||||
3. Enable **"Use as Quick Action"** → **Finder**, name it `Cloudreve Share`.
|
||||
4. In Finder: right-click a file → **Quick Actions** → **Cloudreve Share**.
|
||||
|
||||
(Requires `cloudreve-share` on PATH and `python3`, which ships with macOS
|
||||
Command Line Tools.)
|
||||
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
# cloudreve-share — open the Cloudreve share dialog for local file(s).
|
||||
# macOS counterpart of desktop/linux/cloudreve-share; usable from Terminal:
|
||||
# cloudreve-share ~/Cloudreve/report.pdf
|
||||
# or from a Finder Quick Action (see README.md in this directory).
|
||||
#
|
||||
# Works whether the app is running or not — the app bundle registers the
|
||||
# cloudreve:// scheme and processes share deep links passed at cold start.
|
||||
|
||||
set -eu
|
||||
|
||||
for f in "$@"; do
|
||||
encoded=$(python3 -c 'import sys, urllib.parse; print(urllib.parse.quote(sys.argv[1]))' "$f")
|
||||
open "cloudreve://share/$encoded"
|
||||
done
|
||||
Loading…
Reference in new issue