diff options
author | Ben Burwell <ben@benburwell.com> | 2019-12-12 17:23:05 -0500 |
---|---|---|
committer | Ben Burwell <ben@benburwell.com> | 2019-12-12 17:23:05 -0500 |
commit | 735a06f9cb4766b5d888af02bcf56ead62e8cb4e (patch) | |
tree | 391ac27531d95e20f251c0baeccb66a020b2b736 /templates/.bin | |
parent | 72d46bb8d8af6e0ece0ac6eca2a1985692d28c19 (diff) |
sway: integrate password-store
Diffstat (limited to 'templates/.bin')
-rwxr-xr-x | templates/.bin/passmenu | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/templates/.bin/passmenu b/templates/.bin/passmenu new file mode 100755 index 0000000..8284ff2 --- /dev/null +++ b/templates/.bin/passmenu @@ -0,0 +1,14 @@ +#!/usr/bin/env bash + +shopt -s nullglob globstar + +prefix=${PASSWORD_STORE_DIR-~/.password-store} +password_files=( "$prefix"/**/*.gpg ) +password_files=( "${password_files[@]#"$prefix"/}" ) +password_files=( "${password_files[@]%.gpg}" ) + +password=$(printf '%s\n' "${password_files[@]}" | dmenu "$@") + +[[ -n $password ]] || exit + +pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } | wl-copy |