From b7838e980daeaee0f3502bdeb89bf469ddbb5ddc Mon Sep 17 00:00:00 2001 From: Sanchayan Maity Date: Thu, 15 Dec 2022 09:59:28 +0530 Subject: [PATCH] fish: functions/gt: Add helper for getting TOTP tokens with pass --- fish/.config/fish/functions/gt.fish | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 fish/.config/fish/functions/gt.fish diff --git a/fish/.config/fish/functions/gt.fish b/fish/.config/fish/functions/gt.fish new file mode 100644 index 0000000..3d4556b --- /dev/null +++ b/fish/.config/fish/functions/gt.fish @@ -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