totp generation split out; no longer notifies if no TOTP present
This commit is contained in:
parent
c9f1593954
commit
364530fc31
3 changed files with 19 additions and 11 deletions
10
bwzy-copy-totp
Executable file
10
bwzy-copy-totp
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
#/bin/bash
|
||||
|
||||
read -r TOTP_STRING || TOTP_STRING="null"
|
||||
|
||||
# Copy the TOTP to clipboard
|
||||
if [[ "$TOTP_STRING" != "null" ]]; then
|
||||
TOTP=$(echo $TOTP_STRING | sed 's/.*secret=//; s/&.*//' | oathtool -b --totp -)
|
||||
echo -n "$TOTP" | cli-copy
|
||||
[[ -n "$BWZY_NOTIFY_CMD" ]] && $BWZY_NOTIFY_CMD "TOTP copied to clipboard"
|
||||
fi
|
||||
Loading…
Add table
Add a link
Reference in a new issue