From 2ece3cc103b21115e59e80b730194464e138ab2d Mon Sep 17 00:00:00 2001 From: vybe Date: Thu, 21 May 2026 02:36:40 +0000 Subject: [PATCH] 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. --- tailscalectl/TailscaleWidget.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tailscalectl/TailscaleWidget.qml b/tailscalectl/TailscaleWidget.qml index cb3fc82..d1849de 100644 --- a/tailscalectl/TailscaleWidget.qml +++ b/tailscalectl/TailscaleWidget.qml @@ -62,7 +62,7 @@ PluginComponent { Process { 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 { onStreamFinished: {