From 03e59ad8c7be3c0739b28c9122ecdd79c0b09b55 Mon Sep 17 00:00:00 2001 From: littleblack111 Date: Thu, 14 Aug 2025 21:38:50 +0800 Subject: refactor(clip): use Quickshell.execDetached when avaliable --- services/Clip.qml | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) (limited to 'services') diff --git a/services/Clip.qml b/services/Clip.qml index b83c6d8..d03976c 100644 --- a/services/Clip.qml +++ b/services/Clip.qml @@ -15,9 +15,6 @@ Searchable { property list _clipImg: [] property list _clipImgIds: _clipImg.map(p => p.split("/").pop().split(".").shift()) - property var toDecode: "" - property string toCopy: "" - list: { if (!_clipHist?.length) return []; @@ -59,13 +56,11 @@ Searchable { } function decodeAndCopy(text) { - toDecode = text; - decodeAndCopyProc.running = true; + Quickshell.execDetached(["sh", "-c", `cliphist decode ${text} | wl-copy`]); } function copy(text) { - toCopy = text; - copyProc.running = true; + Quickshell.execDetached(["wl-copy", text]); } function _update() { @@ -73,15 +68,6 @@ Searchable { imgProc.running = true; } - Process { - id: decodeAndCopyProc - running: false - command: ["sh", "-c", "cliphist decode " + toDecode + " | wl-copy"] - onExited: { - toDecode = ""; - } - } - Process { id: clipProc running: true @@ -118,15 +104,6 @@ Searchable { } } - Process { - id: copyProc - running: false - command: ["wl-copy", toCopy] - onExited: { - toCopy = ""; - } - } - Process { id: watchProc running: true -- cgit v1.2.3