mirror of https://github.com/ericonr/dotfiles.git
Update utils.
- get-otp: simplify - lessg: move, include doas inside
This commit is contained in:
parent
fde98dee72
commit
1b6020874f
|
@ -1,10 +1,13 @@
|
|||
#!/bin/sh
|
||||
file="${OTP_ACCOUNTS:-$HOME/.local/share/otp_accounts}"
|
||||
json="$(cbc-file unlock "$file")"
|
||||
label="$(printf %s "$json" | jq '.[].label' | fzf --cycle)"
|
||||
label="$(printf %s "$json" |
|
||||
jq '.[].label' |
|
||||
fzf --cycle -1 ${1:+--query "$1"}
|
||||
)"
|
||||
secret="$(printf %s "$json" |
|
||||
jq ".[] | select (.label | contains($label))" |
|
||||
jq --raw-output .secret)"
|
||||
jq --raw-output ".[] | select (.label | contains($label)) | .secret"
|
||||
)"
|
||||
token="$(oathtool --totp -b -d 6 "$secret")"
|
||||
printf %s $token
|
||||
|
||||
|
|
|
@ -1,4 +1,5 @@
|
|||
#!/bin/execlineb -P
|
||||
doas
|
||||
pipeline
|
||||
{ dmesg --color=always }
|
||||
less -R
|
Loading…
Reference in New Issue