fix: use if/elif/else in clipboard detection script

The previous &&/|| chain evaluated all commands, producing multi-line
output when multiple tools were installed. parseClipboardDetection
correctly rejected this as invalid, falling back to 'none'. The
if/elif/else structure ensures only the first match is echoed.
This commit is contained in:
Vybe (Coding Agent) 2026-05-21 02:36:40 +00:00
parent 6ef933211c
commit 2ece3cc103

View file

@ -62,7 +62,7 @@ PluginComponent {
Process { Process {
id: detectClipboard id: detectClipboard
command: ["sh", "-c", "which dms >/dev/null 2>&1 && echo 'dms cl copy' || which wl-copy >/dev/null 2>&1 && echo 'wl-copy' || which clipmanctl >/dev/null 2>&1 && echo 'clipmanctl copy' || which xclip >/dev/null 2>&1 && echo 'xclip -selection clipboard' || which xsel >/dev/null 2>&1 && echo 'xsel --clipboard --input' || echo none"] command: ["sh", "-c", "if which dms >/dev/null 2>&1; then echo 'dms cl copy'; elif which wl-copy >/dev/null 2>&1; then echo 'wl-copy'; elif which clipmanctl >/dev/null 2>&1; then echo 'clipmanctl copy'; elif which xclip >/dev/null 2>&1; then echo 'xclip -selection clipboard'; elif which xsel >/dev/null 2>&1; then echo 'xsel --clipboard --input'; else echo none; fi"]
stdout: StdioCollector { stdout: StdioCollector {
onStreamFinished: { onStreamFinished: {