From e77de273fff7da749cafe6dfefacd4a03f823474 Mon Sep 17 00:00:00 2001 From: Neil Chudleigh <5580824+nchudleigh@users.noreply.github.com> Date: Tue, 3 Nov 2026 17:31:02 -0500 Subject: [PATCH] Paste with Ctrl+Shift+V in terminals and Herdr MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Shift+Insert pastes the primary selection in Alacritty, Kitty and Ghostty, and Herdr passes it to the pane's program as an Insert key. Read the focused window's class and send Ctrl+Shift+V to terminals (SPEC §5.3); other apps keep Shift+Insert. Co-Authored-By: Claude Opus 5.5 --- services/ClipboardWriter.qml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/services/ClipboardWriter.qml b/services/ClipboardWriter.qml index 4df6c6c..8a2e8bf 100644 --- a/services/ClipboardWriter.qml +++ b/services/ClipboardWriter.qml @@ -25,7 +25,15 @@ Item { // Constant scripts: no caller data ever reaches the command line. readonly property string copyScript: 'exec wl-copy' // Wait for the launcher to unmap, as omarchy-clipboard-paste-text does. - readonly property string pasteScript: 'wl-copy || exit; sleep 0.15; wtype -M shift -k Insert -m shift 2>/dev/null || true' + // Terminals take Ctrl+Shift+V (SPEC §5.3): most map Shift+Insert to the + // primary selection, and Herdr passes it to the pane's program. + readonly property string pasteScript: 'wl-copy || exit; sleep 0.15 +class=$(hyprctl activewindow -j 2>/dev/null | jq -r ".class // empty" 2>/dev/null) +case ${class,,} in + *alacritty*|*kitty*|foot|footclient|*wezterm*|*ghostty*|*konsole*|*gnome-terminal*|*ptyxis*|*herdr*) + wtype -M ctrl -M shift -k v -m shift -m ctrl 2>/dev/null || true ;; + *) wtype -M shift -k Insert -m shift 2>/dev/null || true ;; +esac' Process { id: proc