aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2015-08-20 18:07:29 +0200
committerRasmus Steinke <rasi@xssn.at>2015-08-20 18:07:29 +0200
commit8dfb824153fa9b0ee4ef84f2a09012c57c55dd2b (patch)
treec2b109f9c8e4567f7f4ad2711aeb6d2a6ebf0aa5
parent46031aa052d0883cdfffbcc180d38f12ad6d04bf (diff)
downloadrofi-pass-8dfb824153fa9b0ee4ef84f2a09012c57c55dd2b.tar.gz
little fix
-rw-r--r--config.example2
-rwxr-xr-xrofi-pass11
2 files changed, 5 insertions, 8 deletions
diff --git a/config.example b/config.example
index baeadd3..3f58372 100644
--- a/config.example
+++ b/config.example
@@ -1,5 +1,5 @@
# permanently set alternative root dir
-root=/home/carnager/test-store
+# root=/path/to/root
# optional rofi parameters:
# keep in mind that 0.15.7 has different arguments compared to
diff --git a/rofi-pass b/rofi-pass
index db5ccc1..1756833 100755
--- a/rofi-pass
+++ b/rofi-pass
@@ -30,7 +30,7 @@ if [[ -n "$2" && "$1" == "--root" ]]; then
root="${2}"
else
if [[ -n $root ]]; then
- root="${basedir}"
+ root="${root}"
else
root="$HOME/.password-store"
fi
@@ -39,14 +39,11 @@ PASSWORD_STORE_DIR="${root}"
# get all password files and create an array
list_passwords() {
- if [[ -z "$root" ]]; then
- passwords=( "$HOME/.password-store"/**/*.gpg )
- else
- passwords=( "${root}"/**/*.gpg )
- fi
+ cd "${root}"
+ passwords=( **/*.gpg )
for password in "${passwords[@]}"; do
- filename="${password#$root}"
+ filename="${password}"
filename="${filename%.gpg}"
echo "$filename"
done