aboutsummaryrefslogtreecommitdiffstats
path: root/addpass
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2015-10-15 01:33:33 +0200
committerRasmus Steinke <rasi@xssn.at>2015-10-15 01:33:33 +0200
commitc49a623a1c8d0c28edd3fcfb553a796e631e0e29 (patch)
treed457db7f720615a99c22d4b3d3630935f90a5bff /addpass
parentd0f16247202cc6d7082698db2d3128cb92d4708e (diff)
downloadrofi-pass-c49a623a1c8d0c28edd3fcfb553a796e631e0e29.tar.gz
add support for no groups for adding passes
Diffstat (limited to 'addpass')
-rwxr-xr-xaddpass8
1 files changed, 6 insertions, 2 deletions
diff --git a/addpass b/addpass
index b733eb7..a34ec2a 100755
--- a/addpass
+++ b/addpass
@@ -45,7 +45,7 @@ fieldsArray=($fields);
read -p "Enter password for entry \"${Name}\" > " -s pass
cd "${root}"
-group=$(find -type d -not -iwholename '*.git*' -printf '%d\t%P\n' | sort -r -nk1 | cut -f2- | rofi -dmenu -p "Choose Group > ")
+group=$(echo -e "No Group\n---\n$(find -type d -not -iwholename '*.git*' -printf '%d\t%P\n' | sort -r -nk1 | cut -f2-)" | rofi -dmenu -p "Choose Group > ")
echo -e "\n\nStoring file ${Name} in group ${group}"
@@ -58,5 +58,9 @@ printEntry () {
done
}
-printEntry | PASSWORD_STORE_DIR="${root}" pass insert -m "${group}/${Name}"
+if [[ $group == "No Group" ]]; then
+ printEntry | PASSWORD_STORE_DIR="${root}" pass insert -m "${Name}"
+else
+ printEntry | PASSWORD_STORE_DIR="${root}" pass insert -m "${group}/${Name}"
+fi