aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRasmus Steinke <rasi@xssn.at>2017-02-04 08:58:00 +0100
committerRasmus Steinke <rasi@xssn.at>2017-02-04 08:58:00 +0100
commit99e2257cefe5406468047450c4fafad16d868784 (patch)
treeb101644c98727d597852a0fa1ea7a41ebbbf44de
parent1e439d3c54b19c758da4d7b83bba740e6493b5c9 (diff)
downloadrofi-pass-99e2257cefe5406468047450c4fafad16d868784.tar.gz
Add copy to action menu
-rwxr-xr-xrofi-pass19
1 files changed, 15 insertions, 4 deletions
diff --git a/rofi-pass b/rofi-pass
index 1a5ac10..788c0c6 100755
--- a/rofi-pass
+++ b/rofi-pass
@@ -377,14 +377,16 @@ copyMenu () {
actionMenu () {
checkIfPass
- action=$(echo -e "< Return\n---\n1 Move Password File\n2 Delete Password File\\n3 Edit Password File\n4 Generate New Password" | _rofi -dmenu -p "Choose Action > ")
+ action=$(echo -e "< Return\n---\n1 Move Password File\n2 Copy Password File\n3 Delete Password File\\n4 Edit Password File\n5 Generate New Password" | _rofi -dmenu -p "Choose Action > ")
if [[ ${action} == "1 Move Password File" ]]; then
manageEntry move;
- elif [[ ${action} == "2 Delete Password File" ]]; then
+ elif [[ ${action} == "3 Delete Password File" ]]; then
manageEntry delete;
- elif [[ ${action} == "3 Edit Password File" ]]; then
+ elif [[ ${action} == "2 Copy Password File" ]]; then
+ manageEntry copy;
+ elif [[ ${action} == "4 Edit Password File" ]]; then
manageEntry edit;
- elif [[ ${action} == "4 Generate New Password" ]]; then
+ elif [[ ${action} == "5 Generate New Password" ]]; then
generatePass;
elif [[ ${action} == "< Return" ]]; then
mainMenu;
@@ -456,6 +458,15 @@ manageEntry () {
fi
PASSWORD_STORE_DIR="${root}" pass mv "$selected_password" "${group}"
mainMenu
+ elif [[ $1 == "copy" ]]; then
+ cd "${root}" || exit
+ selected_password2=$(basename "$selected_password" .gpg)
+ group=$(find -type d -not -iwholename '*.git*' -printf '%d\t%P\n' | sort -r -nk1 | cut -f2- | _rofi -dmenu -p "Choose Group > ")
+ if [[ $group == "" ]]; then
+ exit
+ fi
+ PASSWORD_STORE_DIR="${root}" pass cp "$selected_password" "${group}"
+ mainMenu
elif [[ "$1" == "delete" ]]; then
HELP="<span color='$help_color'>Selected entry: ${selected_password}</span>"
ask=$(echo -e "Yes\nNo" | _rofi -mesg "${HELP}" -dmenu -p "Are You Sure? > ")