From 1d7a9d6cde4e13553579d3ca9f440dc9517bc77e Mon Sep 17 00:00:00 2001 From: Alan Silva Date: Sun, 6 Sep 2026 00:47:44 +0100 Subject: [PATCH] Keep clipboard shortcuts routed to built-in source --- Clipboard.qml | 14 +------------- README.md | 8 ++++---- install.sh | 14 +++++++------- manifest.json | 2 +- 4 files changed, 13 insertions(+), 25 deletions(-) diff --git a/Clipboard.qml b/Clipboard.qml index 0228282..2ad23b1 100644 --- a/Clipboard.qml +++ b/Clipboard.qml @@ -83,20 +83,8 @@ Item { else root.open() } - // Direct target for explicit bindings and pause/resume automation. - IpcHandler { - target: "alanfortlink.clipboard" - function open(): void { root.open() } - function close(): void { root.close() } - function show(): void { root.open() } - function hide(): void { root.close() } - function toggle(): void { root.toggle() } - function pause(payloadJson: string): string { return root.pause(payloadJson) } - function isPaused(): string { return root.isPaused() } - } - // ------------------------------------------------------------ pause - // Toggle via IPC: omarchy-shell alanfortlink.clipboard pause '{"paused":true}' + // Toggle via IPC: omarchy-shell shell call alanfortlink.clipboard pause '{"paused":true}' // (or {"paused":false}, or {"paused":"toggle"}), and Ctrl+Space in the picker. function setPaused(next) { root.paused = !!next diff --git a/README.md b/README.md index a3665c3..78ad3f5 100644 --- a/README.md +++ b/README.md @@ -68,8 +68,8 @@ For a custom binding, edit the **live** config — but is not sourced): ```lua -o.bind("SUPER + SHIFT + V", "Clipboard manager (clipboard-history)", - "omarchy-shell alanfortlink.clipboard toggle") +o.bind("SUPER + SHIFT + V", "Clipboard manager", + "omarchy-shell shell toggle omarchy.clipboard") ``` (If your config is still legacy `bindings.conf`: `bindd = ALT SHIFT, V, …`.) @@ -92,8 +92,8 @@ Updating: `omarchy plugin update alanfortlink.clipboard` · Uninstall: `omarchy Pause/resume is also scriptable — useful for automation or a custom binding: ```bash -omarchy-shell alanfortlink.clipboard pause '{"paused":"toggle"}' -omarchy-shell alanfortlink.clipboard isPaused +omarchy-shell shell call alanfortlink.clipboard pause '{"paused":"toggle"}' +omarchy-shell shell call alanfortlink.clipboard isPaused ``` ## Configuration diff --git a/install.sh b/install.sh index 685720d..1822463 100755 --- a/install.sh +++ b/install.sh @@ -5,7 +5,7 @@ # - rescans + enables it (shell.json gets plugins[] entry; the built-in # omarchy.clipboard is recorded in disabledPlugins[] and routed here) # - checks and installs dependencies transparently (QR/OCR degrade without them) -# - binds SUPER+SHIFT+V and ALT+SHIFT+V directly to this picker (with backup) +# - binds SUPER+SHIFT+V and ALT+SHIFT+V to the clone-aware source id (with backup) set -euo pipefail REPO_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" @@ -58,9 +58,9 @@ fi echo "==> Enabling $PLUGIN_ID (replaces built-in omarchy.clipboard)" omarchy plugin enable "$PLUGIN_ID" -echo "==> Binding SUPER+SHIFT+V and ALT+SHIFT+V directly to $PLUGIN_ID" -# Do not route through `shell toggle`: plugin rescans can leave its panel Loader -# stale. The plugin-owned IPC target always controls the mapped picker window. +echo "==> Binding SUPER+SHIFT+V and ALT+SHIFT+V to the clipboard source" +# Always target the built-in source id. Omarchy routes it to this clone while +# installed, then automatically routes it back to the built-in after removal. rebound=0 if [[ -f $HOME/.config/hypr/bindings.lua ]]; then LUA="$HOME/.config/hypr/bindings.lua" @@ -68,7 +68,7 @@ if [[ -f $HOME/.config/hypr/bindings.lua ]]; then python3 - "$LUA" >"$tmp" <<'PY' import re, sys text = open(sys.argv[1]).read() -command = "omarchy-shell alanfortlink.clipboard toggle" +command = "omarchy-shell shell toggle omarchy.clipboard" for chord in ("SUPER + SHIFT + V", "ALT + SHIFT + V"): line = f'o.bind("{chord}", "Clipboard manager (clipboard-history)", "{command}")' pattern = re.compile(r'^\s*o\.bind\("' + re.escape(chord) + r'".*$', re.M) @@ -92,8 +92,8 @@ elif [[ -f $HOME/.config/hypr/bindings.conf ]]; then cp "$CONF" "$CONF.bak.$(date +%s)" sed -i '/^bindd = \(SUPER\|ALT\) SHIFT, V, /d' "$CONF" printf '%s\n' \ - 'bindd = SUPER SHIFT, V, Clipboard manager (clipboard-history), exec, omarchy-shell alanfortlink.clipboard toggle' \ - 'bindd = ALT SHIFT, V, Clipboard manager (clipboard-history), exec, omarchy-shell alanfortlink.clipboard toggle' >>"$CONF" + 'bindd = SUPER SHIFT, V, Clipboard manager, exec, omarchy-shell shell toggle omarchy.clipboard' \ + 'bindd = ALT SHIFT, V, Clipboard manager, exec, omarchy-shell shell toggle omarchy.clipboard' >>"$CONF" echo " updated bindings.conf (backup created)" rebound=1 fi diff --git a/manifest.json b/manifest.json index 4a8f646..b3cc028 100644 --- a/manifest.json +++ b/manifest.json @@ -2,7 +2,7 @@ "schemaVersion": 1, "id": "alanfortlink.clipboard", "name": "Clipboard History", - "version": "1.0.6", + "version": "1.0.7", "author": "alanfortlink", "description": "Raycast-style clipboard history: fuzzy search over content, type, app and date, with rich per-type previews", "kinds": [