X-Git-Url: https://git.armaanb.net/?a=blobdiff_plain;f=passmenu;h=44681efce03b9fcccc174b3867885de69cca1735;hb=5329b8bc0f05967aedb6e9817662326ae1f4f27c;hp=9978c219d5b327090216cecf1234bd5eca6bf2bd;hpb=55a218e51cd587265c04508f816b8b2fff56840e;p=bin.git diff --git a/passmenu b/passmenu index 9978c21..44681ef 100755 --- a/passmenu +++ b/passmenu @@ -1,5 +1,5 @@ #!/usr/bin/env sh -# A POSIX compliant reimplementation of passmenu. Derived from: +# A POSIX compliant reimplementation of passmenu for pash. Derived from: # https://git.zx2c4.com/password-store/tree/contrib/dmenu/passmenu typeit=0 @@ -8,7 +8,7 @@ if [ "$1" = "--type" ]; then shift fi -prefix=${PASSWORD_STORE_DIR-~/.password-store} +prefix=${PASH_DIR-~/.local/share/pash} password=$(find "$prefix" -name '*.gpg' | awk -v prefix="$prefix" \ '{len = length(prefix) + 2; print substr($0, len, length($0) - len - 3)}' \ | dmenu "$@") @@ -16,8 +16,8 @@ password=$(find "$prefix" -name '*.gpg' | awk -v prefix="$prefix" \ [ -n "$password" ] || exit if [ $typeit -eq 0 ]; then - pass show -c "$password" 2>/dev/null + pash show "$password" | head -n 1 | xclip -sel c else - pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } | + pash show "$password" | { IFS= read -r pass; printf %s "$pass"; } | xdotool type --clearmodifiers --file - fi