Clipboard: added auto-paste option.

This commit is contained in:
Lemmy
2026-01-04 19:18:32 -05:00
parent dfc1c2739c
commit b637caaf20
20 changed files with 128 additions and 21 deletions
+15
View File
@@ -171,6 +171,11 @@ Singleton {
stdout: StdioCollector {}
}
Process {
id: pasteProc
stdout: StdioCollector {}
}
Process {
id: deleteProc
stdout: StdioCollector {}
@@ -320,6 +325,16 @@ Singleton {
copyProc.running = true;
}
function pasteFromClipboard(id) {
if (!root.cliphistAvailable) {
return;
}
// Copy to clipboard and then simulate Ctrl+V paste using wtype
// Uses sleep to ensure clipboard is updated before paste
pasteProc.command = ["sh", "-lc", `cliphist decode ${id} | wl-copy && wtype -M ctrl -M shift v`];
pasteProc.running = true;
}
function deleteById(id) {
if (!root.cliphistAvailable) {
return;