From 03648310717e788464e40964f7356d4b5b2674f8 Mon Sep 17 00:00:00 2001 From: João Lucas Date: Sat, 4 Jan 2025 00:13:04 +0000 Subject: posix compliance: replace `echo -e` --- anypinentry | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/anypinentry b/anypinentry index 8808939..4cf5c0d 100755 --- a/anypinentry +++ b/anypinentry @@ -22,7 +22,7 @@ AP_YES="Yes"; AP_NO="No"; prompt_action='dmenu -P -p "$AP_PROMPT"'; -confirm_action='echo -e "$AP_YES\n$AP_NO" | dmenu -p "$AP_PROMPT"'; +confirm_action='printf "%s\n%s\n" "$AP_YES" "$AP_NO" | dmenu -p "$AP_PROMPT"'; display_error_action='notify-send -a "Pinentry" "$AP_ERROR"'; # :: Prompt string (default if empty) @@ -212,7 +212,7 @@ Options: CMD will be executed by sh(1). The defaults are: prompt ='dmenu -P -p "$prompt_string"'; -confirm ='echo -e "$AP_YES\n$AP_NO" | dmenu -p "$prompt_string"'; +confirm ='printf "%s\n%s\n" "$AP_YES" "$AP_NO" | dmenu -p "$prompt_string"'; error-command ='notify-send -a "Pinentry" "$error__password_mismatch"'; Standard pinentry options -- cgit v1.3.1 From 6a4ac1d25ab564a176037b2efb95a66b6a2d9f9b Mon Sep 17 00:00:00 2001 From: João Lucas Date: Sat, 4 Jan 2025 01:27:53 +0000 Subject: update readme and remove unnecessary \n --- README.md | 2 +- anypinentry | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 4f462aa..56672aa 100644 --- a/README.md +++ b/README.md @@ -22,5 +22,5 @@ The following variables inside `./anypinentry` script file can be configured. You will need to use `AP_PROMPT`, `AP_YES`, `AP_NO`, `AP_ERROR` variables inside your actions. * `prompt_action` - Action to show a prompt asking for password (Example using dmenu with password patch - `dmenu -P -p "$AP_PROMPT"`) -* `confirm_action` - Action to confirm something (YES or NO) (Example with dmenu - `echo -e "$AP_YES\n$AP_NO" | dmenu -p "$AP_PROMPT"`) +* `confirm_action` - Action to confirm something (YES or NO) (Example with dmenu - `printf "%s\n%s" "$AP_YES" "$AP_NO" | dmenu -p "$AP_PROMPT"`) * `display_error_action` - Action to display error messages to user (Example with notify-send - `notify-send "$AP_ERROR"`) diff --git a/anypinentry b/anypinentry index 4cf5c0d..5fe0424 100755 --- a/anypinentry +++ b/anypinentry @@ -22,7 +22,7 @@ AP_YES="Yes"; AP_NO="No"; prompt_action='dmenu -P -p "$AP_PROMPT"'; -confirm_action='printf "%s\n%s\n" "$AP_YES" "$AP_NO" | dmenu -p "$AP_PROMPT"'; +confirm_action='printf "%s\n%s" "$AP_YES" "$AP_NO" | dmenu -p "$AP_PROMPT"'; display_error_action='notify-send -a "Pinentry" "$AP_ERROR"'; # :: Prompt string (default if empty) @@ -212,7 +212,7 @@ Options: CMD will be executed by sh(1). The defaults are: prompt ='dmenu -P -p "$prompt_string"'; -confirm ='printf "%s\n%s\n" "$AP_YES" "$AP_NO" | dmenu -p "$prompt_string"'; +confirm ='printf "%s\n%s" "$AP_YES" "$AP_NO" | dmenu -p "$prompt_string"'; error-command ='notify-send -a "Pinentry" "$error__password_mismatch"'; Standard pinentry options -- cgit v1.3.1