aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xrofi-pass30
1 files changed, 22 insertions, 8 deletions
diff --git a/rofi-pass b/rofi-pass
index 87376a0..3be06b0 100755
--- a/rofi-pass
+++ b/rofi-pass
@@ -25,15 +25,17 @@ if [[ -z $BROWSER ]]; then
fi
if [[ -n "$2" ]]; then
- root="${basedir}/${2}"
- clear
- echo "$root"
+ root="${2}"
else
- root="${basedir}"
+ :
fi
list_passwords() {
- passwords=( "${root}"/**/*.gpg )
+ if [[ -n "$root" ]]; then
+ passwords=( "${basedir}/${root}"/**/*.gpg )
+ else
+ passwords=( "${basedir}"/**/*.gpg )
+ fi
for password in "${passwords[@]}"; do
filename="${password#$basedir}"
@@ -204,12 +206,24 @@ insertPass () {
elif [[ $menu == "" ]]; then exit
elif [[ $menu == "* Accept Values and Add Password Entry" ]]; then
notab=$(echo -e "Yes\nNo" | rofi -dmenu -p "Page uses Auto Tab? > ")
- cd "$HOME"/.password-store/"${root}"
+ if [[ -n "$root" ]]; then
+ cd "${basedir}/${root}"
+ else
+ cd "${basedir}"
+ fi
group=$(find -type d -not -iwholename '*.git*' -printf '%d\t%P\n' | sort -r -nk1 | cut -f2- | rofi -dmenu -p "Choose Group > ")
if [[ "$notab" == "No" ]]; then
- pass insert -m -f "${root}"/"$group"/"$name" < <(echo -e "${pass}\nUserName: ${user}\n---\nURL: ${domain}")
+ if [[ -n "$root" ]]; then
+ pass insert -m -f "${root}/${group}/${name}" < <(echo -e "${pass}\nUserName: ${user}\n---\nURL: ${domain}")
+ else
+ pass insert -m -f "${group}/${name}" < <(echo -e "${pass}\nUserName: ${user}\n---\nURL: ${domain}")
+ fi
elif [[ "$notab" == "Yes" ]]; then
- pass insert -m -f "${root}"/"$group"/"$name" < <(echo -e "${pass}\nUserName: ${user}\n---\nURL: ${domain}\nNOTAB")
+ if [[ -n "$root" ]]; then
+ pass insert -m -f "${root}"/"$group"/"$name" < <(echo -e "${pass}\nUserName: ${user}\n---\nURL: ${domain}\nNOTAB")
+ else
+ pass insert -m -f "$group"/"$name" < <(echo -e "${pass}\nUserName: ${user}\n---\nURL: ${domain}\nNOTAB")
+ fi
fi
elif [[ $menu == "1 Name"* ]]; then
name=$(echo "" | rofi -dmenu -p "Enter Name > ")