blob: 535cc312b7d4d9e986ba966c95a58edde4285c48 (
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 "*-OTP.gpg" | cut -c $chars- | \
rev | cut -c 5- | rev)
acct="$(echo "$accts" | dmenu)"
pass otp code $acct | xclip -r -selection "primary" \
&& pass otp code $acct | xclip -r -selection "clipboard" \
&& notify-send "OTP copied to clipboard" \
&& sleep $ct \
&& pkill xclip
|