dotfiles

Cem's Dotfiles
git clone git://git.ckyln.com/dotfiles.git
Log | Files | Refs | Submodules | README | LICENSE

commit e3147fdfb4ce78cb85dabdd55b221874582c824f
parent 23f99aa0001f276890b7e7316caba0bde9e1c92b
Author: Cem Keylan <cem@ckyln.com>
Date:   Wed, 30 Oct 2019 10:36:16 +0300

added passmenu

Diffstat:
A.local/bin/passmenu | 27+++++++++++++++++++++++++++
1 file changed, 27 insertions(+), 0 deletions(-)

diff --git a/.local/bin/passmenu b/.local/bin/passmenu @@ -0,0 +1,27 @@ +#!/usr/bin/env bash + +# Script taken from https://git.zx2c4.com/password-store/tree/contrib/dmenu + +shopt -s nullglob globstar + +typeit=0 +if [[ $1 == "--type" ]]; then + typeit=1 + shift +fi + +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[@]}" | dmenu "$@") + +[[ -n $password ]] || exit + +if [[ $typeit -eq 0 ]]; then + pass show -c "$password" 2>/dev/null +else + pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } | + xdotool type --clearmodifiers --file - +fi