yk-cli/scripts/yk.fish

21 lines
634 B
Fish
Raw Normal View History

2020-12-11 04:55:55 +00:00
# Disable file completions
complete -c yk -f
# Add completion for setting password
complete -c yk -a set-password -d "Set authentication password"
# Add completion of credentials
2021-01-07 19:34:33 +00:00
complete -c yk -a "(yk list)" -d "Credential to get TOTP for"
2020-12-11 04:55:55 +00:00
function yk-copy --description "Select a credential using fzf and copy it to clipboard"
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
2020-12-11 04:55:55 +00:00
end