From 95111487107a063b00907f7c7dbc1289fcbd0513 Mon Sep 17 00:00:00 2001 From: Ayush Agarwal Date: Sun, 14 Nov 2021 12:54:07 +0530 Subject: feat: add global variables for more features The TESSEN_USERKEY environment variable can be set to point tessen to a custom key which should be considered as the username. The TESSEN_URLKEY environment variable can be set to point tessen to a custom key which should be considered as the URL of website. The TESSEN_AUTOKEY environment variable can be set to point tessen to a custom key which should be considered for custom auto type operations instead of the default operation of auto typing the username and the password. The TESSEN_DELAY environment variable can be set to make tessen introduce delay when auto typing to avoid errors. The default is 200 milliseconds. 'bemenu' is no longer the default backend. --- tessen | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/tessen b/tessen index d04a5cc..0c46f3a 100755 --- a/tessen +++ b/tessen @@ -8,13 +8,22 @@ # don't leak password data if debug mode is enabled set +x -# initialize the global variables +# GLOBAL VARIABLES +# variables which won't be changed and can be made readonly readonly tsn_version="1.1.2" readonly tsn_prefix="${PASSWORD_STORE_DIR:-$HOME/.password-store}" readonly tsn_cliptime="${PASSWORD_STORE_CLIP_TIME:-15}" -tsn_backend="${TESSEN_BACKEND:-bemenu}" # uses the value of TESSEN_BACKEND if set by user +readonly tsn_delay="${TESSEN_DELAY:-200}" +# variables which hold data for possible actions and choices +tsn_backend="${TESSEN_BACKEND-}" tsn_backend_opts="" -tsn_action="${TESSEN_ACTION-}" # uses the value of TESSEN_ACTION if set by user +tsn_action="${TESSEN_ACTION-}" +tsn_userkey="${TESSEN_USERKEY:-user}" +tsn_urlkey="${TESSEN_URLKEY:-url}" +tsn_autokey="${TESSEN_AUTOKEY:-autotype}" +tsn_autotype="" +tsn_otp=false +# variables with sensitive data which will be manually unset using _clear tsn_passfile="" declare -A tsn_passdata tsn_username="" -- cgit v1.2.3