This commit is contained in:
2025-04-17 10:49:27 -07:00
parent 739e3f8837
commit 35ed3e1343
5 changed files with 8 additions and 7 deletions

22
.local/bin/pass_autofill Executable file
View File

@@ -0,0 +1,22 @@
#!/bin/sh
entry=$(gopass list --flat | bemenu -p Autofill: -l 25 -c -M 500 --fn 'Monospace 14' --tf '#ff4e00' --ff '#dbc077' --hf '#ff4e00')
if [ -n "$entry" ]; then
username=$(gopass show "$entry" | grep '^username:' | cut -d' ' -f2-)
password=$(gopass show -o "$entry")
if [ -z "$password" ]; then
notify-send "Gopass Error" "No password for $entry"
exit 1
fi
notify-send "Autofill in 3s: Focus username field in form"
sleep 1
# Type username, press Tab, then password, then Enter
wtype "$username"
wtype -k Tab
wtype "$password"
wtype -k Return
fi