diff options
| author | littleblack111 <littleblack11111@gmail.com> | 2025-08-14 21:38:50 +0800 |
|---|---|---|
| committer | littleblack111 <littleblack11111@gmail.com> | 2025-08-15 14:25:14 +0800 |
| commit | 03e59ad8c7be3c0739b28c9122ecdd79c0b09b55 (patch) | |
| tree | 2f6dac9b6fc0945857c0fd1c8a1d440f3f6357b0 /services | |
| parent | 27e616664366a53b0dd934f01d9ba1c1339725d2 (diff) | |
refactor(clip): use Quickshell.execDetached when avaliable
Diffstat (limited to 'services')
| -rw-r--r-- | services/Clip.qml | 27 |
1 files changed, 2 insertions, 25 deletions
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<string> _clipImg: [] property list<string> _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() { @@ -74,15 +69,6 @@ Searchable { } Process { - id: decodeAndCopyProc - running: false - command: ["sh", "-c", "cliphist decode " + toDecode + " | wl-copy"] - onExited: { - toDecode = ""; - } - } - - Process { id: clipProc running: true command: ["cliphist", "-preview-width", 9 ** 9, "-max-items", 9 ** 9, "list"] @@ -119,15 +105,6 @@ Searchable { } Process { - id: copyProc - running: false - command: ["wl-copy", toCopy] - onExited: { - toCopy = ""; - } - } - - Process { id: watchProc running: true command: ["wl-paste", "-w", "echo"] |
