|
|
|
|
@@ -63,8 +63,8 @@ clipboard_backend=${ROFI_PASS_CLIPBOARD_BACKEND:-xclip}
|
|
|
|
|
backend=${ROFI_PASS_BACKEND:-xdotool}
|
|
|
|
|
|
|
|
|
|
case "$clipboard_backend" in
|
|
|
|
|
"xclip") ;;
|
|
|
|
|
"wl-clipboard") ;;
|
|
|
|
|
"xclip");;
|
|
|
|
|
"wl-clipboard");;
|
|
|
|
|
*)
|
|
|
|
|
>&2 echo "Invalid clipboard backend '$clipboard_backend', falling back to xclip"
|
|
|
|
|
clipboard_backend=xclip
|
|
|
|
|
@@ -72,9 +72,8 @@ case "$clipboard_backend" in
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
case "$backend" in
|
|
|
|
|
"xdotool") ;;
|
|
|
|
|
"ydotool") ;;
|
|
|
|
|
"wtype") ;;
|
|
|
|
|
"xdotool");;
|
|
|
|
|
"wtype");;
|
|
|
|
|
*)
|
|
|
|
|
>&2 echo "Invalid backend '$backend', falling back to xdotool"
|
|
|
|
|
backend=xdotool
|
|
|
|
|
@@ -122,10 +121,6 @@ _do_type_xdotool() {
|
|
|
|
|
xdotool type --delay ${type_delay} --clearmodifiers --file -
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_do_type_ydotool() {
|
|
|
|
|
ydotool type --key-delay ${type_delay} --file -
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
_do_type_wtype() {
|
|
|
|
|
wtype -d ${type_delay} -
|
|
|
|
|
}
|
|
|
|
|
@@ -160,7 +155,7 @@ doClip () {
|
|
|
|
|
case "$clip" in
|
|
|
|
|
"primary") ${clip_in_primary} ;;
|
|
|
|
|
"clipboard") ${clip_in_clipboard} ;;
|
|
|
|
|
"both") ${clip_in_primary}; ${clip_out_primary} | ${clip_in_clipboard} ;;
|
|
|
|
|
"both") ${clip_in_primary}; ${clip_out_primary} | ${clip_in_clipboard};;
|
|
|
|
|
esac
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -179,14 +174,14 @@ autopass () {
|
|
|
|
|
printf '%s\n' "${root}: $selected_password" > "$cache_dir/rofi-pass/last_used"
|
|
|
|
|
for word in ${stuff["$AUTOTYPE_field"]}; do
|
|
|
|
|
case "$word" in
|
|
|
|
|
":tab") ${do_press_key} Tab ;;
|
|
|
|
|
":space") ${do_press_key} space ;;
|
|
|
|
|
":delay") sleep "${delay}" ;;
|
|
|
|
|
":enter") ${do_press_key} Return ;;
|
|
|
|
|
":otp") printf '%s' "$(generateOTP)" | ${do_type} ;;
|
|
|
|
|
"pass") printf '%s' "${password}" | ${do_type} ;;
|
|
|
|
|
"path") printf '%s' "${selected_password}" | rev | cut -d'/' -f1 | rev | ${do_type} ;;
|
|
|
|
|
*) printf '%s' "${stuff[${word}]}" | ${do_type} ;;
|
|
|
|
|
":tab") ${do_press_key} Tab;;
|
|
|
|
|
":space") ${do_press_key} space;;
|
|
|
|
|
":delay") sleep "${delay}";;
|
|
|
|
|
":enter") ${do_press_key} Return;;
|
|
|
|
|
":otp") printf '%s' "$(generateOTP)" | ${do_type};;
|
|
|
|
|
"pass") printf '%s' "${password}" | ${do_type};;
|
|
|
|
|
"path") printf '%s' "${selected_password}" | rev | cut -d'/' -f1 | rev | ${do_type};;
|
|
|
|
|
*) printf '%s' "${stuff[${word}]}" | ${do_type};;
|
|
|
|
|
esac
|
|
|
|
|
done
|
|
|
|
|
|
|
|
|
|
@@ -478,10 +473,10 @@ mainMenu () {
|
|
|
|
|
# Actions based on exit code, which do not need the entry.
|
|
|
|
|
# The exit code for -kb-custom-X is X+9.
|
|
|
|
|
case "${rofi_exit}" in
|
|
|
|
|
19) roots_index=$(( (roots_index-1+roots_length) % roots_length)); root=${roots[$roots_index]}; mainMenu; return ;;
|
|
|
|
|
20) roots_index=$(( (roots_index+1) % roots_length)); root=${roots[$roots_index]}; mainMenu; return ;;
|
|
|
|
|
25) helpMenu; return ;;
|
|
|
|
|
26) ${basecommand} --bmarks; return ;;
|
|
|
|
|
19) roots_index=$(( (roots_index-1+roots_length) % roots_length)); root=${roots[$roots_index]}; mainMenu; return;;
|
|
|
|
|
20) roots_index=$(( (roots_index+1) % roots_length)); root=${roots[$roots_index]}; mainMenu; return;;
|
|
|
|
|
25) helpMenu; return;;
|
|
|
|
|
26) ${basecommand} --bmarks; return;;
|
|
|
|
|
esac
|
|
|
|
|
|
|
|
|
|
mapfile -t password_temp < <(PASSWORD_STORE_DIR="${root}" pass show "$selected_password")
|
|
|
|
|
@@ -543,21 +538,21 @@ mainMenu () {
|
|
|
|
|
# actions based on keypresses
|
|
|
|
|
# The exit code for -kb-custom-X is X+9.
|
|
|
|
|
case "${rofi_exit}" in
|
|
|
|
|
0) typeMenu ;;
|
|
|
|
|
10) sleep $wait; autopass ;;
|
|
|
|
|
11) sleep $wait; typeUser ;;
|
|
|
|
|
12) sleep $wait; typePass ;;
|
|
|
|
|
13) openURL ;;
|
|
|
|
|
14) copyUser ;;
|
|
|
|
|
15) copyPass ;;
|
|
|
|
|
16) viewEntry ;;
|
|
|
|
|
17) copyURL ;;
|
|
|
|
|
18) default_do="menu" typeMenu ;;
|
|
|
|
|
21) sleep $wait; typefield=OTP; typeField ;;
|
|
|
|
|
23) actionMenu ;;
|
|
|
|
|
24) copyMenu ;;
|
|
|
|
|
27) insertPass ;;
|
|
|
|
|
28) generateQrCode ;;
|
|
|
|
|
0) typeMenu;;
|
|
|
|
|
10) sleep $wait; autopass;;
|
|
|
|
|
11) sleep $wait; typeUser;;
|
|
|
|
|
12) sleep $wait; typePass;;
|
|
|
|
|
13) openURL;;
|
|
|
|
|
14) copyUser;;
|
|
|
|
|
15) copyPass;;
|
|
|
|
|
16) viewEntry;;
|
|
|
|
|
17) copyURL;;
|
|
|
|
|
18) default_do="menu" typeMenu;;
|
|
|
|
|
21) sleep $wait; typefield=OTP; typeField;;
|
|
|
|
|
23) actionMenu;;
|
|
|
|
|
24) copyMenu;;
|
|
|
|
|
27) insertPass;;
|
|
|
|
|
28) generateQrCode;;
|
|
|
|
|
esac
|
|
|
|
|
clearUp
|
|
|
|
|
}
|
|
|
|
|
@@ -595,13 +590,13 @@ helpMenu () {
|
|
|
|
|
${previous_root}: Switch to previous password store (--root)
|
|
|
|
|
${next_root}: Switch to next password store (--root)
|
|
|
|
|
EOM
|
|
|
|
|
help_val=$?
|
|
|
|
|
help_val=$?
|
|
|
|
|
|
|
|
|
|
if [[ $help_val -eq 1 ]]; then
|
|
|
|
|
if [[ $help_val -eq 1 ]]; then
|
|
|
|
|
exit;
|
|
|
|
|
else
|
|
|
|
|
else
|
|
|
|
|
unset helptext; mainMenu;
|
|
|
|
|
fi
|
|
|
|
|
fi
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@@ -617,9 +612,9 @@ typeMenu () {
|
|
|
|
|
exit
|
|
|
|
|
fi
|
|
|
|
|
case "$typefield" in
|
|
|
|
|
'') exit ;;
|
|
|
|
|
'pass') sleep $wait; typePass ;;
|
|
|
|
|
"${AUTOTYPE_field}") sleep $wait; autopass ;;
|
|
|
|
|
'') exit;;
|
|
|
|
|
'pass') sleep $wait; typePass;;
|
|
|
|
|
"${AUTOTYPE_field}") sleep $wait; autopass;;
|
|
|
|
|
*) sleep $wait; typeField
|
|
|
|
|
esac
|
|
|
|
|
clearUp
|
|
|
|
|
|