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:
parent
6ef933211c
commit
2ece3cc103
1 changed files with 1 additions and 1 deletions
|
|
@ -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: {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue