This repository has been archived on 2026-01-23. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
2017-03-30 22:32:15 -06:00

29 lines
657 B
Bash
Executable File

#!/bin/bash
#based on https://github.com/cdown/passmenu
#and jasnowryan.com/blog
shopt -s nullglob globstar
nb='#2F4F4F'
nf='#00FFFF'
sb='#2F4F4F'
sf='#ADFF2F'
font="Inconsolataicon-12"
dmenucmd=( dmenu -i -fn "$font" -nb "$nb" -nf "$nf" -sb "$sb" -sf "$sf" )
prefix=${PASSWORD_STORE_DIR:-~/.password-store}
files=( "$prefix"/**/*.gpg )
files=( "${files[@]#"$prefix"/}" )
files=( "${files[@]%.gpg}" )
fbase=( "${files[@]##*/}" )
word=$(printf '%s\n' "${fbase[@]}" | "${dmenucmd[@]}" "$@")
if [[ -n $word ]]; then
for match in "${files[@]}"; do
if [[ $word == ${match#*/} ]]; then
/usr/bin/pass show -c "$match" 2>/dev/null
fi
done
fi