#!/usr/bin/env sh store="$HOME/.password-store" lscmd="ls --group-directories-first" if [ "$MENUCMD" = "tofi" ] then menucmd="tofi --matching-algorithm prefix --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}"