fish: functions/gt: Add helper for getting TOTP tokens with pass

This commit is contained in:
Sanchayan Maity 2022-12-15 09:59:28 +05:30
parent 0f5ba5ef04
commit b7838e980d
1 changed files with 10 additions and 0 deletions

View File

@ -0,0 +1,10 @@
function gt --description "Get TOTP token with pass-otp"
if type -qf pass
pass ls totp | fzf --ansi | sed 's/[^a-zA-Z0-9]//g' | read -l result
if test -n "$result"
pass otp -c totp/$result
end
else
echo "pass is not installed"
end
end