Fix large clipboard history pastes

Clipboard history selections passed the full selected text as a process argument to omarchy-clipboard-paste-text. Large entries can exceed Linux's per-argument exec limit, so the helper never starts reliably for big copied blocks.

Pass the original history index instead and have the helper read that entry from clipboard-history.json before wl-copy and Shift+Insert. Also focus the first row when opening the manager, keep filtered rows mapped to their original history indexes, and drop whitespace-only text entries.
This commit is contained in:
David Heinemeier Hansson
2026-05-29 12:21:28 +02:00
parent 6be9b8b6d9
commit e79013adbe
4 changed files with 74 additions and 12 deletions
+2 -2
View File
@@ -40,7 +40,7 @@ Item {
root.opened = true
root.filterText = ""
root.selectedIndex = 0
root.cursorActive = false
root.cursorActive = true
root.rebuildDisplay()
Qt.callLater(function() { keyCatcher.forceActiveFocus() })
}
@@ -140,7 +140,7 @@ Item {
if (row.entryType === "image") {
Quickshell.execDetached([root.omarchyPath + "/bin/omarchy-clipboard-paste-file", row.mime, row.path])
} else if (row.fullText) {
Quickshell.execDetached([root.omarchyPath + "/bin/omarchy-clipboard-paste-text", "--shift-insert", row.fullText])
Quickshell.execDetached([root.omarchyPath + "/bin/omarchy-clipboard-paste-text", "--shift-insert", "--history-index", String(row.index)])
}
}