#!/usr/bin/env bash # Password form autofill (using dmenu) # Selected password is typed in the focused window automatically. PASS_STORE=$HOME/.password-store pushd $PASS_STORE >/dev/null PASSWORD=$(tree -if . | sed -n 's/\.\/\(.\+\)\.gpg$/\1/p' | dmenu -l 10 -h 23) [ -z "$PASSWORD" ] && exit 0 pass show "$PASSWORD" | sed 1q | tr -d '\n' | xdotool type --clearmodifiers --file - popd >/dev/null