From fe93010b04441ae4469730ed7dc4070310591167 Mon Sep 17 00:00:00 2001 From: coderkun Date: Sat, 4 Jul 2020 13:37:20 +0200 Subject: [PATCH] =?UTF-8?q?Add=20script=20=E2=80=9Cpassmenu=E2=80=9D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Add the script “passmenu” to provide the same functionality as the official “passmenu” script but using “bemenu” instead of “dmenu”. --- passmenu | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100755 passmenu diff --git a/passmenu b/passmenu new file mode 100755 index 0000000..5108e6e --- /dev/null +++ b/passmenu @@ -0,0 +1,17 @@ +#!/bin/sh +set -e +shopt -s nullglob globstar + +# Present menu to select password +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[@]}" | bemenu $@) + +# Copy password to clipboard +pass show -c "$password" 2>/dev/null + +# Send notification +notify-send -u critical -t 45000 "Password in clipboard" \ + "The password for \"$password\" is currently in the clipboard."