add ":tab" for autotype. also make it possible to use password at any position. This makes rofi-pass compatible with autopass (https://github.com/jreinert/autopass)
This commit is contained in:
parent
9de35776ae
commit
59bfc20ba0
48
rofi-pass
48
rofi-pass
@ -96,6 +96,7 @@ ${open_url}: Open URL | ${copy_name}: Copy Username | ${copy_pass}: Copy Passwor
|
|||||||
_val=$(echo "${LINE}" | awk -F': ' '{print $2}')
|
_val=$(echo "${LINE}" | awk -F': ' '{print $2}')
|
||||||
stuff["${_id}"]=${_val}
|
stuff["${_id}"]=${_val}
|
||||||
done < <(pass "${selected_password}" | tail -n+2 | grep ': ')
|
done < <(pass "${selected_password}" | tail -n+2 | grep ': ')
|
||||||
|
stuff["password"]=${password}
|
||||||
|
|
||||||
if [[ $rofi_exit -eq 11 ]]; then
|
if [[ $rofi_exit -eq 11 ]]; then
|
||||||
xdotool_type "${stuff[${USERNAME_field}]}"
|
xdotool_type "${stuff[${USERNAME_field}]}"
|
||||||
@ -113,43 +114,26 @@ ${open_url}: Open URL | ${copy_name}: Copy Username | ${copy_pass}: Copy Passwor
|
|||||||
$(sleep 45; echo -n "" | xclip; echo "" | xclip -selection clipboard | notify-send "rofi-pass" "Clipboard cleared") &
|
$(sleep 45; echo -n "" | xclip; echo "" | xclip -selection clipboard | notify-send "rofi-pass" "Clipboard cleared") &
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
if [[ $(echo "${password_temp}" | tail -1) == "NOTAB" ]]; then
|
if [[ -z "${stuff["$AUTOTYPE_field"]}" ]]; then
|
||||||
if [[ -z "${stuff['CustomOrder']}" ]]; then
|
xdotool_type "${stuff[${USERNAME_field}]}"
|
||||||
xdotool_type "${stuff[${USERNAME_field}]}"
|
xdotool_type "$password"
|
||||||
xdotool_type "$password"
|
sleep 1
|
||||||
if [[ ${auto_enter} == "true" ]]; then
|
if [[ ${auto_enter} == "true" ]]; then
|
||||||
xdotool key Return
|
xdotool key Return
|
||||||
fi
|
|
||||||
else
|
|
||||||
for word in ${stuff['CustomOrder']}; do
|
|
||||||
xdotool_type "${stuff[${word}]}"
|
|
||||||
done
|
|
||||||
xdotool_type "$password"
|
|
||||||
if [[ ${auto_enter} == "true" ]]; then
|
|
||||||
xdotool key Return
|
|
||||||
fi
|
|
||||||
fi
|
fi
|
||||||
exit
|
|
||||||
else
|
else
|
||||||
if [[ -z "${stuff['CustomOrder']}" ]]; then
|
for word in ${stuff["$AUTOTYPE_field"]}; do
|
||||||
xdotool_type "${stuff[${USERNAME_field}]}"
|
if [[ $word == ":tab" ]]; then
|
||||||
xdotool key Tab
|
|
||||||
xdotool_type "$password"
|
|
||||||
sleep 1
|
|
||||||
if [[ ${auto_enter} == "true" ]]; then
|
|
||||||
xdotool key Return
|
|
||||||
fi
|
|
||||||
else
|
|
||||||
for word in ${stuff['CustomOrder']}; do
|
|
||||||
xdotool_type "${stuff[${word}]}"
|
|
||||||
xdotool key Tab
|
xdotool key Tab
|
||||||
done
|
else
|
||||||
xdotool_type "$password"
|
xdotool_type "${stuff[${word}]}"
|
||||||
if [[ ${auto_enter} == "true" ]]; then
|
|
||||||
xdotool key Return
|
|
||||||
fi
|
fi
|
||||||
|
#xdotool key Tab
|
||||||
|
done
|
||||||
|
#xdotool_type "$password"
|
||||||
|
if [[ ${auto_enter} == "true" ]]; then
|
||||||
|
xdotool key Return
|
||||||
fi
|
fi
|
||||||
exit
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# cleanup (for the paranoid)
|
# cleanup (for the paranoid)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user