add possibility to generate a new password for entry
This commit is contained in:
parent
46f88a25c2
commit
24992e36b1
@ -27,6 +27,7 @@ BROWSER='chromium'
|
|||||||
help_color='#0C73C2'
|
help_color='#0C73C2'
|
||||||
auto_enter='false'
|
auto_enter='false'
|
||||||
notify='false'
|
notify='false'
|
||||||
|
passlength='20'
|
||||||
|
|
||||||
# seconds to wait before re-opening showEntry-menu
|
# seconds to wait before re-opening showEntry-menu
|
||||||
# after autotyping an entry. Set to "off" to disable
|
# after autotyping an entry. Set to "off" to disable
|
||||||
@ -49,3 +50,4 @@ move="Alt+2"
|
|||||||
delete="Alt+3"
|
delete="Alt+3"
|
||||||
copy_entry="Alt+c"
|
copy_entry="Alt+c"
|
||||||
show="Control+Return"
|
show="Control+Return"
|
||||||
|
generate="Alt+g"
|
||||||
|
22
rofi-pass
22
rofi-pass
@ -39,7 +39,7 @@ checkIfPass () {
|
|||||||
|
|
||||||
# main Menu
|
# main Menu
|
||||||
mainMenu () {
|
mainMenu () {
|
||||||
help_text=$(echo -e "${autotype}: Autotype - ${copy_name}: Copy User - ${edit}: Edit - ${show}: Show Entry\n${type_user}: Type User - ${copy_pass}: Copy Pass - ${move}: Move\n${type_pass}: Type Pass - ${copy_url}: Copy URL - ${delete}: Delete" | column -s '-' -t)
|
help_text=$(echo -e "${autotype}: Autotype - ${copy_name}: Copy User - ${edit}: Edit - ${show}: Show Entry\n${type_user}: Type User - ${copy_pass}: Copy Pass - ${move}: Move - ${generate}: Generate Pass\n${type_pass}: Type Pass - ${copy_url}: Copy URL - ${delete}: Delete" | column -s '-' -t)
|
||||||
line1=$(echo "${help_text}" | head -1)
|
line1=$(echo "${help_text}" | head -1)
|
||||||
line2=$(echo "${help_text}" | tail -2 | head -1)
|
line2=$(echo "${help_text}" | tail -2 | head -1)
|
||||||
line3=$(echo "${help_text}" | tail -1)
|
line3=$(echo "${help_text}" | tail -1)
|
||||||
@ -59,6 +59,7 @@ ${line3}</span>"
|
|||||||
-kb-custom-9 "${edit}" \
|
-kb-custom-9 "${edit}" \
|
||||||
-kb-custom-10 "${move}" \
|
-kb-custom-10 "${move}" \
|
||||||
-kb-custom-11 "${delete}" \
|
-kb-custom-11 "${delete}" \
|
||||||
|
-kb-custom-12 "${generate}" \
|
||||||
-dmenu \
|
-dmenu \
|
||||||
-select "$entry" \
|
-select "$entry" \
|
||||||
-p "rofi-pass > ")"
|
-p "rofi-pass > ")"
|
||||||
@ -122,6 +123,25 @@ ${line3}</span>"
|
|||||||
elif [[ "${rofi_exit}" -eq 20 ]]; then
|
elif [[ "${rofi_exit}" -eq 20 ]]; then
|
||||||
manageEntry delete;
|
manageEntry delete;
|
||||||
|
|
||||||
|
elif [[ "${rofi_exit}" -eq 21 ]]; then
|
||||||
|
checkIfPass
|
||||||
|
symbols=$(echo -e "0 Cancel\n---\n1 Yes\n2 No" | rofi -dmenu -p "Use Symbols? > ")
|
||||||
|
if [[ $symbols == "0 Cancel" ]]; then
|
||||||
|
mainMenu
|
||||||
|
elif [[ $symbols == "1 Yes" ]]; then
|
||||||
|
symbols=""
|
||||||
|
elif [[ $symbols == "2 No" ]]; then
|
||||||
|
symbols="-n"
|
||||||
|
fi
|
||||||
|
HELP="<span color='$help_color'>Enter Number or hit Enter to use default length</span>"
|
||||||
|
length=$(echo -e "" | rofi -dmenu -mesg "${HELP}" -p "Password length? (Default: ${passlength}) > ")
|
||||||
|
if [[ $length == "" ]]; then
|
||||||
|
pass generate ${symbols} -i "$selected_password" "${passlength}" > /dev/null
|
||||||
|
else
|
||||||
|
pass generate ${symbols} -i "$selected_password" "${length}" > /dev/null
|
||||||
|
fi
|
||||||
|
exit
|
||||||
|
|
||||||
elif [[ $rofi_exit -eq 12 ]]; then
|
elif [[ $rofi_exit -eq 12 ]]; then
|
||||||
checkIfPass
|
checkIfPass
|
||||||
echo -n "${password}" | xdotool type --clearmodifiers --file -
|
echo -n "${password}" | xdotool type --clearmodifiers --file -
|
||||||
|
Loading…
x
Reference in New Issue
Block a user