From a0089cb4a117930f3b9c36bcbbd6be8cf3747ff8 Mon Sep 17 00:00:00 2001 From: johannst Date: Tue, 19 May 2020 22:02:41 +0200 Subject: added rofi config + installer --- scripts/rofi_pass.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100755 scripts/rofi_pass.sh (limited to 'scripts') diff --git a/scripts/rofi_pass.sh b/scripts/rofi_pass.sh new file mode 100755 index 0000000..5382670 --- /dev/null +++ b/scripts/rofi_pass.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +# dotfiles -- scripts/rofi_pass.sh +# author: johannst +# +# run as: rofi -show pass -modi pass:./rofi_pass.sh +# +# rofi will invoke this script without args to populate the selection dialogue. +# After selecting one element, rofi will invoke this script with the selection +# as argument. + +prefix=${PASSWORD_STORE_DIR:-~/.password-store} + +echo "1: $1" >> ~/ROFI + +password=$1 +if [ -z $password ]; then + shopt -s nullglob globstar + passwords=($prefix/**/*.gpg) + passwords=(${passwords[@]#$prefix/}) + passwords=(${passwords[@]%.gpg} ) + printf '%s\n' ${passwords[@]} +else + # Run async with coproc (rofi intrinsic) + # else rofi UI blocks pinentry. + coproc (pass show -c $password &> /dev/null) +fi -- cgit v1.2.3