~alexdavid/dotfiles

8744862ec95fb88beb3070e5f1e74eae458ac157 — Alex David a month ago 1dbe530
[experimental] Use fzf for pass menu
3 files changed, 11 insertions(+), 7 deletions(-)

M bin/custompassmenu
A sway/actions/pass
M sway/config
M bin/custompassmenu => bin/custompassmenu +3 -5
@@ 6,7 6,7 @@
shopt -s nullglob globstar

function menu {
  printf '%s\n' "${@:2}" | bemenu --prompt "$1"
  printf '%s\n' "${@:2}" | fzf --reverse --prompt="$1 "
}

prefix=${PASSWORD_STORE_DIR-~/.password-store}


@@ 39,10 39,8 @@ pass show "$password_name" | {
  [ -n "$key" ] || exit

  if [ "$key" = "otpauth" ]; then
    value=$(pass otp "$password_name")
    pass otp "$password_name"
  else
    value="${map["$key"]}"
    echo "${map["$key"]}"
  fi

  printf "%s" "$value" | wtype -s 100 - &
}

A sway/actions/pass => sway/actions/pass +6 -0
@@ 0,0 1,6 @@
#!/usr/bin/env sh

export TMP="$(mktemp)"
popup-term sh -c "custompassmenu '$1' > '$TMP'"
printf '%s' "$(<"$TMP")" | wtype -s 100 -
rm "$TMP"

M sway/config => sway/config +2 -2
@@ 54,8 54,8 @@ bindsym $mod+n exec ~/.config/firefox/launch "New Temporary Profile"
bindsym $mod+Shift+n exec ~/.config/firefox/launch
bindsym $mod+t exec ~/.config/bin/toggle-colors

bindsym $mod+backslash exec custompassmenu
bindsym $alt+Mod4+backslash exec custompassmenu --last
bindsym $mod+backslash exec ~/.config/sway/actions/pass
bindsym $alt+Mod4+backslash exec ~/.config/sway/actions/pass --last

bindsym $mod+Tab focus mode_toggle