diff options
author | Ayush Agarwal <ayushnix@fastmail.com> | 2023-03-21 11:44:49 +0530 |
---|---|---|
committer | Ayush Agarwal <ayushnix@fastmail.com> | 2023-03-21 11:58:55 +0530 |
commit | ca9629fcb8ea21cfc12e000f9d1c714ce275c80b (patch) | |
tree | f1e825aaf556768a48f70d81210b49dc41dde7b9 /tessen | |
parent | 25de9c8cc87e26d5d7688e6d2faf1b4bb1c936e3 (diff) |
feat: map exit codes to OTP autotype and copy
Diffstat (limited to 'tessen')
-rwxr-xr-x | tessen | 11 |
1 files changed, 10 insertions, 1 deletions
@@ -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 } |