From 001bf7c3db29018f5837f6c09bfc7ccfc1bda442 Mon Sep 17 00:00:00 2001 From: Nulo Date: Sun, 6 Feb 2022 23:53:50 -0300 Subject: [PATCH] pass-fuzzel --- .local/bin/pass-fuzzel | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100755 .local/bin/pass-fuzzel 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."