Fallback to the slower --list-devices if device not immediately available

This commit is contained in:
Jason Nader 2020-05-21 13:21:48 +09:00 committed by Fabian Homborg
parent 68a1f2b20a
commit 65dde5b55a

View File

@ -1,5 +1,6 @@
function __complete_devices
kdeconnect-cli --shell-device-autocompletion=zsh | string replace -rf '(\w+)\[(.*)]' '$1\t$2'
kdeconnect-cli --shell-device-autocompletion=zsh | string replace -rf -- '(\w+)\[(.*)]' '$1\t$2'
or kdeconnect-cli --list-devices 2>/dev/null | string replace -rf -- '- (.*): (\w+) .*' '$2\t$1'
end
complete -c kdeconnect-cli -s l -l list-devices -d "List all devices"