summaryrefslogtreecommitdiff
path: root/.local/bin/getpass
blob: 1f9b3b5369a4cd734f2257e4401e671af0e58405 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh

pb=$PASSWORD_STORE_DIR
[ -z "$PASSWORD_STORE_CLIP_TIME" ] && ct=45 || ct=$PASSWORD_STORE_CLIP_TIME
chars=$(echo $pb | wc -c)
accts=$(find $pb -type f -name "*.gpg" | cut -c 2- | cut -c $chars- | \
		rev | cut -c 5- | rev)
acct="$(echo "$accts" | dmenu)"
[ "$acct" = "" ] && exit
pass show $acct | head -1 | xclip -r -selection "primary" \
		&& pass show $acct | head -1 | xclip -r -selection "clipboard" \
		&& notify-send "Password Copied to Clipboard" \
		&& sleep $ct \
		&& pkill xclip