Initial scaffold: blob store server, CLI scripts, and PWA share target
Clipboard/screenshot sync across own devices via a single DEVICE_TOKEN-gated blob store, plus a small installable web app so a phone can push/pull clips and share screenshots via the OS share sheet.
This commit is contained in:
Executable
+21
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/env bash
|
||||
# Reads the system clipboard and pushes it to scrot as a `clip` blob.
|
||||
set -euo pipefail
|
||||
|
||||
: "${SCROT_SERVER:?set SCROT_SERVER, e.g. https://scrot.example.com}"
|
||||
: "${DEVICE_TOKEN:?set DEVICE_TOKEN}"
|
||||
|
||||
if [ -n "${WAYLAND_DISPLAY:-}" ]; then
|
||||
content=$(wl-paste --no-newline)
|
||||
else
|
||||
content=$(xclip -selection clipboard -o)
|
||||
fi
|
||||
|
||||
curl -sf -X POST "$SCROT_SERVER/api/blobs" \
|
||||
-H "X-Device-Token: $DEVICE_TOKEN" \
|
||||
-H "X-Blob-Kind: clip" \
|
||||
-H "Content-Type: text/plain; charset=utf-8" \
|
||||
--data-binary "$content" \
|
||||
-o /dev/null
|
||||
|
||||
echo "clip pushed"
|
||||
Reference in New Issue
Block a user