Adding passwmenu for a pass menu on wayland.

This commit is contained in:
Derek Taylor
2024-11-07 16:44:14 -06:00
parent c914d1e9aa
commit 640026258a
2 changed files with 39 additions and 1 deletions

25
.config/hypr/passwmenu Executable file
View File

@@ -0,0 +1,25 @@
#!/usr/bin/env bash
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[@]}" | wofi --dmenu "$@")
[[ -n $password ]] || exit
if [[ $typeit -eq 0 ]]; then
gopass show -c "$password" 2>/dev/null
else
pass show "$password" | { IFS= read -r pass; printf %s "$pass"; } |
ydotool type --clearmodifiers --file -
fi