summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAyush Agarwal <ayushnix@fastmail.com>2023-03-21 11:44:49 +0530
committerAyush Agarwal <ayushnix@fastmail.com>2023-03-21 11:58:55 +0530
commitca9629fcb8ea21cfc12e000f9d1c714ce275c80b (patch)
treef1e825aaf556768a48f70d81210b49dc41dde7b9
parent25de9c8cc87e26d5d7688e6d2faf1b4bb1c936e3 (diff)
feat: map exit codes to OTP autotype and copy
-rwxr-xr-xtessen11
1 files changed, 10 insertions, 1 deletions
diff --git a/tessen b/tessen
index 23bc6ab..239a227 100755
--- a/tessen
+++ b/tessen
@@ -166,6 +166,8 @@ custom_keyb_action() {
14) wld_copy "$_TSN_USERNAME" ;;
15) wld_copy "$_TSN_PASSWORD" ;;
16) wld_copy "$_TSN_URL" ;;
+ 17) key_otp autotype ;;
+ 18) key_otp copy ;;
*) _die "unmapped exit code detected" ;;
esac
}
@@ -320,7 +322,14 @@ key_otp() {
if ! [[ $tmp_otp =~ ^[[:digit:]]+$ ]]; then
_die "invalid OTP detected"
fi
- key_action "$tmp_otp"
+
+ if [[ "$1" == "autotype" ]]; then
+ auto_type "$tmp_otp"
+ elif [[ "$1" == "copy" ]]; then
+ wld_copy "$tmp_otp"
+ else
+ key_action "$tmp_otp"
+ fi
unset -v tmp_otp
}