aboutsummaryrefslogtreecommitdiffstats
path: root/.config/herbstluftwm/otp.sh
blob: fc81f135bc2fabc2d494a970f06e327fa052c9a7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#!/usr/bin/env zsh

source ~/.config/init/vars

local password_files

password_files=( ~/.password-store/**/otp-*.gpg )
password_files=( ${password_files:t:r:s/otp-//} )

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 "OTP:"  | cut -d ')' -f 1 | read choice

[[ -n $choice ]] || exit

pass otp code -c otp-$choice