Add support for a couple other clipboard tools to helper script
This commit is contained in:
parent
73b6aef9d9
commit
c688f8ce00
@ -6,5 +6,15 @@ complete -c yk -a set-password -d "Set authentication password"
|
|||||||
complete -c yk -a "(yk list)" -d "Credential to get TOTP for"
|
complete -c yk -a "(yk list)" -d "Credential to get TOTP for"
|
||||||
|
|
||||||
function yk-copy --description "Select a credential using fzf and copy it to clipboard"
|
function yk-copy --description "Select a credential using fzf and copy it to clipboard"
|
||||||
yk (yk list | fzf) | pbcopy
|
set result (yk (yk list | fzf))
|
||||||
|
|
||||||
|
if command -q pbcopy
|
||||||
|
echo "$result" | pbcopy
|
||||||
|
else if command -q xsel
|
||||||
|
echo "$result" | xsel --clipboard
|
||||||
|
else if command -q xclip
|
||||||
|
echo "$result" | xclip
|
||||||
|
else
|
||||||
|
echo "No clipboard command found. Code is $result"
|
||||||
|
end
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user