blob: 325197bca0c53685258e87b4a5d9149272d55f08 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
#!/usr/bin/env zsh
source ~/.config/init/vars
zparseopts -M -E -A args \
f -firefox=f
local password_files
setopt extendedglob
password_files=( ~/.password-store/**/^(otp-)*.gpg )
password_files=( ${password_files:t:r} )
printf "%s\n" $password_files | dmenu -fn "${bfont}:size=${bfont_size}" -i \
-h "$bheight" -nb "$bar_bg" -nf "$bar_fg" \
-sb "$bg_focus" -sf "$fg_focus" \
-p "Pass:" | cut -d ')' -f 1 | read choice
[[ -n $choice ]] || exit
pass show $choice | sed -n -e 's/^login: //p' | xclip -selection clipboard
pass show $choice | sed -n -e 's/^url: //p' | read url
[[ ${(@k)args[-f]} ]] && firefox --new-tab "$url"
pass show -c $choice
|