From 94827d7696cb701ecd9b2c99ca917305b6111c46 Mon Sep 17 00:00:00 2001 From: vanten-s Date: Sun, 7 Apr 2024 22:44:47 +0200 Subject: [PATCH] Added the ability to have spaces in password names --- dotfiles/scripts/password-select.sh | 6 +++--- dotfiles/scripts/usernames.sh | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dotfiles/scripts/password-select.sh b/dotfiles/scripts/password-select.sh index 90cb182..0a83297 100755 --- a/dotfiles/scripts/password-select.sh +++ b/dotfiles/scripts/password-select.sh @@ -2,16 +2,16 @@ folder="$(ls ~/.password-store/ | sed -e 's/\.gpg$//' | fuzzel -d)" -if [ -z $folder ]; +if [ -z "$folder" ]; then exit fi choice="$(ls ~/.password-store/$folder | sed -e 's/\.gpg$//' | fuzzel -d)" -if [ -z $choice ]; +if [ -z "$choice" ]; then exit fi -wtype -d 10 "$(pass show $folder/$choice | head -n1)" +wtype -d 10 "$(pass show "$folder/$choice" | head -n1)" diff --git a/dotfiles/scripts/usernames.sh b/dotfiles/scripts/usernames.sh index ef694ae..cef672e 100755 --- a/dotfiles/scripts/usernames.sh +++ b/dotfiles/scripts/usernames.sh @@ -2,7 +2,7 @@ folder="$(ls ~/.password-store/ | sed -e 's/\.gpg$//' | fuzzel -d -i)" -if [ -z $folder ]; +if [ -z "$folder" ]; then exit else @@ -11,10 +11,10 @@ fi choice="$(ls ~/.password-store/$folder | sed -e 's/\.gpg$//' | fuzzel -d -i)" -if [ -z $choice ]; +if [ -z "$choice" ]; then exit else - wtype -d 10 $(pass show $folder/$choice | grep username: | sed 's/username: //') + wtype -d 10 $(pass show "$folder/$choice" | grep username: | sed 's/username: //') fi