Moving fzf-pass local versioning.

I'm loosing the versioning but I think I'm going to take this in a
different direction.

1. work with standard browser pass format. Including with pass or as
leading line.
2. Be fully system agnostic (ydotool, of clipboard stuff can be added on
top)
3. Have option to print current full text.

All of these will require significant changes.
This commit is contained in:
James Patrick 2020-06-27 00:24:22 -04:00
parent 099caf3d7a
commit 7999a4110e
3 changed files with 53 additions and 9 deletions

View File

@ -11,7 +11,7 @@ set $scripts $HOME/.config/sway/scripts
set $tty-popup $scripts/tty-popup
set $menu bash ~/.config/sway/scripts/menu
set $pass_menu $term --class fzf-pass -e sh -c /usr/bin/fzf-pass
set $pass_menu $tty-popup pass $scripts/fzf-pass
set $clipman_menu bash ~/.config/sway/scripts/menu_clipman
set $clipman_clear_menu bash ~/.config/sway/scripts/clipman_clear_menu
@ -23,9 +23,8 @@ set $printscreen bash ~/.config/sway/scripts/printscreen
set $PIP floating enabled ; sticky enabled ; border pixel 0
for_window [class="mpv"] $PIP
for_window [class="pip"] $PIP
for_window [window_role="PictureInPicture"] $PIP
for_window [class="feh"] floating enabled ; border pixel 0
for_window [app_id="fzf-pass"] focus, floating enabled, border pixel 1
for_window [class="feh"] $PIP
for_window [app_id="firefox" title="^Picture-in-Picture$"] $PIP
for_window [app_id="tty-popup"] focus; $PIP
for_window [app_id="tty-popup" title="^pass$"] resize set 33 ppt 33 ppt

50
sway/scripts/fzf-pass Executable file
View File

@ -0,0 +1,50 @@
#!/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
PASSDATA="$(pass "$PASSFILE")"
USRNAME="$(echo "$PASSDATA" | grep "username:" | cut -d' ' -f2-)"
PASS="$(echo "$PASSDATA" | head -n 1)"
URL="$(echo "$PASSDATA" | grep url: | cut -d' ' -f2-)"
RESP=$(cat <<EOF | fzf
Autotype
Username
Password
URL
Page
EOF
);
swaymsg move container to workspace 9
case "$RESP" in
Autotype)
ydotool type "$USRNAME" && ydotool key Tab && ydotool type "$PASS" && ydotool key Enter
;;
Username)
ydotool type "$USRNAME"
;;
Password)
ydotool type "$PASS"
;;
URL)
ydotool type "$URL"
;;
Page)
"$(dirname "$0")/tty-popup" info "bash -c 'echo ${PASSDATA} | LESS=R less'"
;;
*)
exit 1
esac

View File

@ -1,5 +0,0 @@
#! /bin/sh
# -*- sh -*-
gopass ls --flat \
| rofi -dmenu -p pass -i \
| xargs --no-run-if-empty gopass show -c