summaryrefslogtreecommitdiff
path: root/bin/guiscripts/mpass
blob: 43f6f09f7c59f92dda211e37e4333e2e03320ffb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/usr/bin/env sh
store="$HOME/.password-store"
lscmd="ls --group-directories-first"
if [ "$MENUCMD" = "tofi" ]
then
	menucmd="tofi --prompt pass:"
elif [ "$MENUCMD" = "dmenu" ]
then
	menucmd="dmenu -l 4 -g 2 -x -i -p pass:" 
else
	menucmd="fzf"
fi
while [ -d "${store}/${file}" ]
do
	choice="$($lscmd "${store}/${file}" | sed 's/\.gpg$//'| $menucmd)"
	[ "$choice" ] || break
	file="${file}/${choice}"
done
pass show -c "${file}"