From c9916f52d7f2af6d1c96706fe5862cff7b6d5470 Mon Sep 17 00:00:00 2001 From: Akshay Nair Date: Sun, 5 Jul 2020 23:52:58 +0530 Subject: Adds dynamic password prompt with dmenu --- TODO.md | 1 + anypinentry | 10 +++++----- 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 -- cgit v1.3.1