diff options
author | Rasmus Steinke <rasi@xssn.at> | 2015-10-15 01:33:33 +0200 |
---|---|---|
committer | Rasmus Steinke <rasi@xssn.at> | 2015-10-15 01:33:33 +0200 |
commit | c49a623a1c8d0c28edd3fcfb553a796e631e0e29 (patch) | |
tree | d457db7f720615a99c22d4b3d3630935f90a5bff /addpass | |
parent | d0f16247202cc6d7082698db2d3128cb92d4708e (diff) | |
download | rofi-pass-c49a623a1c8d0c28edd3fcfb553a796e631e0e29.tar.gz |
add support for no groups for adding passes
Diffstat (limited to 'addpass')
-rwxr-xr-x | addpass | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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 |