aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatěj Cepl <mcepl@cepl.eu>2023-08-07 07:57:36 +0200
committerMatěj Cepl <mcepl@cepl.eu>2023-08-07 07:57:36 +0200
commit4bed7050f1c3f3d9334f3c1524e2cbda80e4a184 (patch)
treee6ea6cdec5f7d55ab452b8ca87dc0791360a55b4
parent83b054b8c1c14ac7c67f9b1850964c7dd47b9132 (diff)
downloadpinentry-rofi-linux_wsl_rofi.tar.gz
Some updates of pinentry-rofi-ABANDONED.shlinux_wsl_rofi
-rwxr-xr-xpinentry-rofi-ABANDONED.sh16
1 files changed, 8 insertions, 8 deletions
diff --git a/pinentry-rofi-ABANDONED.sh b/pinentry-rofi-ABANDONED.sh
index 45e8d4e..0a1ce47 100755
--- a/pinentry-rofi-ABANDONED.sh
+++ b/pinentry-rofi-ABANDONED.sh
@@ -121,7 +121,7 @@ while : ; do
assuan_send "OK"
elif [[ "$line" =~ ^SETKEYINFO ]] ; then
IFS=" " read -ra line_arr <<< "$line"
- unset "line_arr[0]"
+ unset "line_arr[0]" && line_arr=("${line_arr[@]}")
if [[ "${line_arr[0]}" =~ ^--clear ]] ; then
keyinfo=""
else
@@ -141,7 +141,7 @@ while : ; do
#SETDESC Please enter the passphrase for the ssh key%0A ke:yf:in:ge:rp:ri:nt
# rofi << "-mesg" << $1.gsub("<", "&lt;").gsub(/%([0-9A-Fa-f]{2})/) { $1.to_i(16).chr }
IFS=" " read -ra line_arr <<< "$line"
- unset "line_arr[0]"
+ unset "line_arr[0]" && line_arr=("${line_arr[@]}")
win_mesg="${line_arr[*]}"
assuan_send "OK"
elif [[ "$line" =~ ^SETPROMPT ]] ; then
@@ -151,22 +151,22 @@ while : ; do
assuan_send "OK"
elif [[ "$line" =~ ^GETPIN ]] ; then
passw=None
- sys_env="$(systemctl --user show-environment)"
+ sys_env="$(systemctl --user show-environment | tr -s " \t\n" " ")"
IFS=" " read -ra sys_env_arr <<< "$sys_env"
for env_line in "${sys_env_arr[@]}" ; do
log_debug "env_line=${env_line}"
# GPIN_VALID=re.compile(r)
- if [[ "$env_line" =~ ^[A-Za-z_]+=\(.\+\)$ ]] ; then
+ if [[ "$env_line" =~ ^([A-Za-z][A-Za-z_]*)=(.+)$ ]] ; then
log_debug "env_match=${BASH_REMATCH[*]}"
export "${BASH_REMATCH[1]}=${BASH_REMATCH[2]}"
fi
done
-
- rofi_cmd+=" -p ${win_prompt}"
- rofi_cmd+=" -title ${win_title}"
+ rofi_cmd+=" -p '${win_prompt}'"
+ rofi_cmd+=" -title '${win_title}'"
if [[ -n "${win_mesg}" ]] ; then
- rofi_cmd+=" -mesg ${win_mesg}"
+ rofi_cmd+=" -mesg '${win_mesg}'"
fi
+ log_debug "${rofi_cmd}"
passw="$(eval "${rofi_cmd}")"
passw_err=$?
if [[ ${passw_err} -ne 0 ]] ; then