summaryrefslogtreecommitdiff
path: root/bin/guiscripts/fillpass
blob: 358afd1256fa39b4939b7110d2bb6626decf8dff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

pass="$(
	find "${PASSWORD_STORE_DIR:=~/src/password-store/}" -name "*.gpg" |
	sed -e "s@$PASSWORD_STORE_DIR/@@" -e 's/\.gpg$//' |
	commander -x -c)"
[ "$pass" ] || exit 1

login="$(pass show "$pass" | awk '/^login:/ {print $2}')"
password="$(pass show "$pass" | head -n 1)"

if [ "$login" ]
then printf '%s\t%s\n' "$login" "$password" | ydotool type -f -
else printf '%s\n' "$password" | ydotool type -f -
fi