diff options
Diffstat (limited to '.local/bin/getpass')
-rwxr-xr-x | .local/bin/getpass | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/.local/bin/getpass b/.local/bin/getpass new file mode 100755 index 0000000..bfa344f --- /dev/null +++ b/.local/bin/getpass | |||
@@ -0,0 +1,15 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | pb=$PASSWORD_STORE_DIR | ||
4 | [ -z "$PASSWORD_STORE_CLIP_TIME" ] && ct=45 || ct=$PASSWORD_STORE_CLIP_TIME | ||
5 | chars=$(echo $pb | wc -c) | ||
6 | accts=$(find $pb -type f -name "*.gpg" | cut -c 2- | \ | ||
7 | grep -v ".*-OTP.gpg\|.*-2farecovery.gpg" | cut -c $chars- | \ | ||
8 | rev | cut -c 5- | rev) | ||
9 | acct="$(echo "$accts" | dmenu)" | ||
10 | [ "$acct" = "" ] && exit | ||
11 | pass show $acct | xclip -r -selection "primary" \ | ||
12 | && pass show $acct | xclip -r -selection "clipboard" \ | ||
13 | && notify-send "Password Copied to Clipboard" \ | ||
14 | && sleep $ct \ | ||
15 | && pkill xclip | ||