aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAkshay Nair <phenax5@gmail.com>2020-07-05 23:52:58 +0530
committerAkshay Nair <phenax5@gmail.com>2020-07-05 23:52:58 +0530
commitc9916f52d7f2af6d1c96706fe5862cff7b6d5470 (patch)
treefaa5421f0201b8283a5caacc8f74595ce8902a27
parentc3e7c1fb146d86006ce6ef13093e5fe21542cfa4 (diff)
downloadanypinentry-c9916f52d7f2af6d1c96706fe5862cff7b6d5470.tar.gz
anypinentry-c9916f52d7f2af6d1c96706fe5862cff7b6d5470.zip
Adds dynamic password prompt with dmenu
-rw-r--r--TODO.md1
-rwxr-xr-xanypinentry10
2 files changed, 6 insertions, 5 deletions
diff --git a/TODO.md b/TODO.md
index 0508427..fdeea77 100644
--- a/TODO.md
+++ b/TODO.md
@@ -1,6 +1,7 @@
# TODO
- [ ] Cli arg to set password prompt command
- [ ] Cli arg to set confirmation prompt command
+ - [ ] Use text that is provided as commands
- [ ] Clear password support?
- [ ] Add repeat password support
- [ ] Add confirmation command
diff --git a/anypinentry b/anypinentry
index 0384287..bc03360 100755
--- a/anypinentry
+++ b/anypinentry
@@ -8,14 +8,16 @@ if [[ -z "$DISPLAY" ]]; then
fi
title="";
-prompt="";
+prompt="Password :: ";
description="";
keyinfo="";
-prompt_action="";
+prompt_action='dmenu -P -p "$AP_PROMPT"';
+confirm_action='';
ask_password() {
- dmenu -P -p "$prompt" 2> /dev/null;
+ export AP_PROMPT="$prompt";
+ echo -n '' | bash -c "$prompt_action" 2> /dev/null;
}
save_option() {
@@ -79,8 +81,6 @@ parse_cliargs() {
parse_cliargs "$@";
-exit 0;
-
interpret_command "INIT";
while read line; do