James Patrick
3c3ca9309d
- username and password are no longer stored and passed as variables - no longer need to relocated to unused workspace to function. - fixed (hopefully logic in page)
46 lines
1004 B
Bash
Executable File
46 lines
1004 B
Bash
Executable File
#!/usr/bin/env bash
|
|
# Credit goes to https://git.reekynet.com/ReekyMarko/fzf-pass for this.
|
|
|
|
cd "$HOME/.password-store" || exit 1
|
|
PASSFILE=$(tree -Ffi \
|
|
| grep '.gpg' \
|
|
| sed 's/.gpg$//g' \
|
|
| sed 's/^..//' \
|
|
| fzf --reverse --no-info --prompt='pass::' --pointer='➜' --no-multi )
|
|
|
|
|
|
if [ -z "$PASSFILE" ]; then
|
|
exit 0
|
|
fi
|
|
|
|
RESP=$(cat <<EOF | fzf
|
|
Autotype
|
|
Username
|
|
Password
|
|
Page
|
|
EOF
|
|
);
|
|
|
|
case "$RESP" in
|
|
Autotype)
|
|
swaymsg exec "source ~/.profile \
|
|
&& ydotool type \"\$(pass get_user $PASSFILE)\" \
|
|
&& ydotool key TAB \
|
|
&& ydotool type \"\$(pass get_pass $PASSFILE)\""
|
|
;;
|
|
Username)
|
|
swaymsg exec "source ~/.profile \
|
|
&& ydotool type \"\$(pass get_user $PASSFILE)\""
|
|
;;
|
|
Password)
|
|
swaymsg exec "source ~/.profile \
|
|
&& ydotool type \"\$(pass get_pass $PASSFILE)\""
|
|
;;
|
|
Page)
|
|
"$HOME/.config/sway/scripts/tty-popup" info \
|
|
bash -c "pass \"${PASSFILE}\" | LESS=R less"
|
|
;;
|
|
*)
|
|
exit 1
|
|
esac
|