From dd4fd05573c910f471cd4df253656991e05b5b4c Mon Sep 17 00:00:00 2001 From: Ayush Agarwal Date: Wed, 1 Mar 2023 22:21:00 +0530 Subject: refactor: use auto_type procedure --- tessen | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tessen b/tessen index 6e40f06..d12fb30 100755 --- a/tessen +++ b/tessen @@ -270,7 +270,7 @@ key_action() { key_open_url wld_copy "$_TSN_URL" else - printf "%s" "$arg" | wtype -s "$_TSN_DELAY" - + auto_type "$arg" wld_copy "$arg" fi ;; @@ -344,7 +344,7 @@ auto_type_def() { if [[ -z $_TSN_AUTOTYPE ]]; then auto_type "$_TSN_USERNAME" wtype -s "$_TSN_DELAY" -k Tab -- - printf "%s" "$_TSN_PASSWORD" | wtype -s "$_TSN_DELAY" - + auto_type "$_TSN_PASSWORD" else for word in $_TSN_AUTOTYPE; do case "$word" in @@ -353,9 +353,9 @@ auto_type_def() { ":space") wtype -s "$_TSN_DELAY" -k space -- ;; ":enter") wtype -s "$_TSN_DELAY" -k Return -- ;; ":otp") key_otp ;; - path | basename | filename) printf "%s" "${_TSN_PASSFILE##*/}" | wtype -s "$_TSN_DELAY" - ;; - "$tsn_userkey") printf "%s" "$tsn_username" | wtype -s "$_TSN_DELAY" - ;; - pass | password) printf "%s" "$tsn_password" | wtype -s "$_TSN_DELAY" - ;; + path | basename | filename) auto_type "${_TSN_PASSFILE##*/}" ;; + "$_TSN_USERKEY") auto_type "$_TSN_USERNAME" ;; + pass | password) auto_type "$_TSN_PASSWORD" ;; *) if [[ -n ${_TSN_PASSDATA["$word"]} ]]; then auto_type "${_TSN_PASSDATA["$word"]}" -- cgit v1.2.3