fish: functions/gt: Add helper for getting TOTP tokens with pass
This commit is contained in:
parent
0f5ba5ef04
commit
b7838e980d
1 changed files with 10 additions and 0 deletions
10
fish/.config/fish/functions/gt.fish
Normal file
10
fish/.config/fish/functions/gt.fish
Normal 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
|
Loading…
Reference in a new issue