diff --git a/.local/bin/pass-fuzzel b/.local/bin/pass-fuzzel new file mode 100755 index 0000000..314b162 --- /dev/null +++ b/.local/bin/pass-fuzzel @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# Copied in https://git.zx2c4.com/password-store/tree/contrib/dmenu/passmenu + +set -e +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[@]}" | fuzzel-run -d) + +[[ -n $password ]] || exit + +pass show -c "$password" 2>/dev/null + +notify-send pass-fuzzel "Copied $password into the clipboard."