mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
Clipboard: added auto-paste option.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user