dotfiles

<-- duh.
Log | Files | Refs | LICENSE

commit 9daef882afb988f43a3e96f9e0bfc1adaadc24bb
parent 62210b288a3b3fc71ecd8f6c92fb3cf877cceb43
Author: hhvn <dev@haydenvh.com>
Date:   Sat, 13 Mar 2021 18:10:10 +0000

.s/b/dpass: harden against bugs

Diffstat:
M.scripts/bin/dpass | 6+++---
1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/.scripts/bin/dpass b/.scripts/bin/dpass @@ -12,8 +12,8 @@ [ -z $1 ] && echo "${passwd##*: }"|| echo "$@ ${passwd##*: }" exit } -chosen=$(printf "GENERATE\nEDIT\n$(cut -d ':' -f 1 < $PASS)" | dmenu -l 20 -i | tr '[:upper:]' '[:lower:]') -passwd=$(grep "^$chosen: " < $PASS) +chosen=$(printf "GENERATE\n$(cut -d ':' -f 1 < $PASS)" | dmenu -l 20 -i | tr '[:upper:]' '[:lower:]') +passwd=$(awk -F":" -v "chosen=$chosen" '$1 == chosen {print $2}' < .local/pass) case "$chosen" in "") exit 1 ;; @@ -30,7 +30,7 @@ case "$chosen" in ) & ;; *) - printf "${passwd##*: }\n" | xclip + echo "${passwd}" | xclip ( sleep 25 # destroy clipboard to prevent accidental pasting