aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTom Ryder <tom@sanctum.geek.nz>2023-03-26 13:46:14 +1300
committerTom Ryder <tom@sanctum.geek.nz>2023-03-26 13:46:14 +1300
commitfe1d0d5f7d86e0020aae55f7afbd8a9e51c2a881 (patch)
tree454fb0ec272a535589f5683054425253206aa1d2
parentSort .gitignore (diff)
downloaddotfiles-fe1d0d5f7d86e0020aae55f7afbd8a9e51c2a881.tar.gz
dotfiles-fe1d0d5f7d86e0020aae55f7afbd8a9e51c2a881.zip
Correct comments in rofi_pass
-rw-r--r--rofi/bin/rofi_pass.sh8
1 files changed, 5 insertions, 3 deletions
diff --git a/rofi/bin/rofi_pass.sh b/rofi/bin/rofi_pass.sh
index 305143e7..1f768164 100644
--- a/rofi/bin/rofi_pass.sh
+++ b/rofi/bin/rofi_pass.sh
@@ -39,6 +39,9 @@ get_names() {
LC_COLLATE=C sort -f
}
+# Write a password name to a shell to retrieve it, and read its first line;
+# write the name safely to the shell's input rather than as an argument.
+#
get_password() {
name=$1
[ -n "$name" ] || return
@@ -53,9 +56,8 @@ get_password() {
name=$(get_names | rofi -dmenu -i -only_match -p pass) || exit
[ -n "$name" ] || exit
-# Write the password name to a shell to retrieve it, read its first line, and
-# have xdotool write that as if the keyboard; write the name safely to the
-# command's input rather than as an argument.
+# Retrieve the chosen password by name; check that we actually got something
+# back.
#
password=$(get_password "$name") || exit
[ -n "$password" ] || exit