summaryrefslogtreecommitdiff
path: root/tessen
diff options
context:
space:
mode:
authorAyush Agarwal <ayushnix@fastmail.com>2023-03-01 22:21:00 +0530
committerAyush Agarwal <ayushnix@fastmail.com>2023-03-19 01:52:26 +0530
commitdd4fd05573c910f471cd4df253656991e05b5b4c (patch)
tree78a779066bdb45e4b11e3dce59f5ae0fee4ea35f /tessen
parent02603561179e153aa1224825e23dab61849a198c (diff)
refactor: use auto_type procedure
Diffstat (limited to 'tessen')
-rwxr-xr-xtessen10
1 files 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"]}"