Floating card window, retention settings (maxAgeDays/historyLimit/maxRows), pause/resume (Ctrl+= + IPC), LICENSE, README with screenshots, screenshot tooling
This commit is contained in:
Executable
+30
@@ -0,0 +1,30 @@
|
||||
#!/usr/bin/env python3
|
||||
"""Print the PHYSICAL-pixel crop geometry (WxH+X+Y) of the tank-clipboard
|
||||
layer surface on grim's combined framebuffer. Monitors report logical .x/.y
|
||||
with .scale; layers report logical xywh; grim captures physical pixels."""
|
||||
import json
|
||||
import re
|
||||
import subprocess
|
||||
|
||||
layers = subprocess.run(["hyprctl", "layers"], capture_output=True, text=True).stdout
|
||||
m = re.search(r"xywh:\s*(\d+) (\d+) (\d+) (\d+).*namespace: tank-clipboard", layers)
|
||||
if not m:
|
||||
raise SystemExit(1)
|
||||
lx, ly, lw, lh = map(int, m.groups())
|
||||
|
||||
mons = json.loads(subprocess.run(["hyprctl", "monitors", "-j"], capture_output=True, text=True).stdout)
|
||||
# Physical framebuffer layout: monitors sorted by (y, x); each occupies its
|
||||
# physical width/height; offsets accumulate.
|
||||
mons.sort(key=lambda d: (d["y"], d["x"]))
|
||||
for i, d in enumerate(mons):
|
||||
logical_w = d["width"] / d["scale"]
|
||||
if d["x"] <= lx < d["x"] + logical_w and d["y"] <= ly < d["y"] + d["height"] / d["scale"]:
|
||||
phys_x = sum(o["width"] for o in mons[:i])
|
||||
px = phys_x + round((lx - d["x"]) * d["scale"])
|
||||
py = round((ly - d["y"]) * d["scale"])
|
||||
pw = round(lw * d["scale"])
|
||||
ph = round(lh * d["scale"])
|
||||
print(f"{pw}x{ph}+{px}+{py}")
|
||||
break
|
||||
else:
|
||||
raise SystemExit(1)
|
||||
Executable
+47
@@ -0,0 +1,47 @@
|
||||
#!/bin/bash
|
||||
# Regenerate README screenshots (docs/screenshots/*.png).
|
||||
# Stages demo clipboard entries, opens the picker keyboard-free (IPC), and
|
||||
# crops the card from a full-screen capture. Run in a graphical session.
|
||||
set -euo pipefail
|
||||
|
||||
REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
|
||||
OUT="$REPO_DIR/docs/screenshots"
|
||||
mkdir -p "$OUT"
|
||||
|
||||
crop_shot() { # <output.png> — open via IPC first; caller decides what's on screen
|
||||
local out=$1
|
||||
omarchy-shell shell hide tank.clipboard
|
||||
sleep 0.4
|
||||
local geo
|
||||
case $out in
|
||||
"$OUT/search.png")
|
||||
omarchy-shell shell call tank.clipboard debugSetFilter '{"text":"omarchy"}'
|
||||
;;
|
||||
*)
|
||||
omarchy-shell shell toggle tank.clipboard
|
||||
;;
|
||||
esac
|
||||
sleep 1.5
|
||||
local geo; geo=$(python3 "$REPO_DIR/scripts/physical-crop.py")
|
||||
grim /tmp/clipshot-full.png
|
||||
omarchy-shell shell hide tank.clipboard
|
||||
sleep 0.4
|
||||
magick /tmp/clipshot-full.png -crop "$geo" +repage "$out"
|
||||
}
|
||||
|
||||
# ---- stage demo content ----------------------------------------------------
|
||||
qrencode -s 10 -o /tmp/clipshot-qr-repo.png "https://github.com/alanfortlink/clipboard-history"
|
||||
qrencode -s 10 -o /tmp/clipshot-qr-omarchy.png "https://omarchy.org"
|
||||
# stage newest-last so the QR pointing at this repo is selected on open
|
||||
printf 'The quick brown fox jumps over the lazy dog.' | wl-copy; sleep 1.5
|
||||
printf 'function pasteEntry(id) {\n const entry = store.findById(id)\n return paste(entry)\n}' | wl-copy; sleep 1.5
|
||||
printf '#7aa2f7' | wl-copy; sleep 1.5
|
||||
printf 'https://omarchy.org/manual/shell-plugins/' | wl-copy; sleep 1.5
|
||||
wl-copy --type image/png < /tmp/clipshot-qr-omarchy.png; sleep 1.5
|
||||
wl-copy --type image/png < /tmp/clipshot-qr-repo.png; sleep 1.5
|
||||
|
||||
# ---- shots -----------------------------------------------------------------
|
||||
crop_shot "$OUT/picker.png"
|
||||
crop_shot "$OUT/search.png"
|
||||
|
||||
echo "Wrote $OUT/picker.png and $OUT/search.png"
|
||||
Reference in New Issue
Block a user