Created
January 20, 2021 10:16
-
-
Save elumbella/c329f088a2eddd8ea115d5a61a0dda4c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Very basic interface for pass using wofi | |
# Get all password files and create an array | |
root=~/.password-store | |
CACHE=~/.local/tmp/pass_wofi | |
list_passwords() { | |
shopt -s nullglob globstar | |
cd "${root}" || exit | |
pw_list=(**/*.gpg) | |
printf '%s\n' "${pw_list[@]%.gpg}" | sort -n | |
} | |
prompt='search for passwords...' | |
SECRET=$(list_passwords | wofi -i --width 700 --lines 20 --height 250 --prompt="${prompt}" --dmenu --cache-file ${CACHE}) | |
# Get password | |
PASSWD_PASS=$(pass ${SECRET}) | |
# Strip extra lines | |
PASSWD_PASS=(${PASSWD_PASS[@]}) | |
wl-copy -o ${PASSWD_PASS} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment