Browse Source

move to wtype

master
Joel Beckmeyer 1 year ago
parent
commit
e4e520f6f6
  1. 2
      README.md
  2. 12
      wofi-pass

2
README.md

@ -13,7 +13,7 @@ version of `passmenu` that accomplishes everything I needed from `rofi-pass`.
## What does it do?
This script uses [wofi](https://hg.sr.ht/~scoopta/wofi) and
[ydotool](https://github.com/ReimuNotMoe/ydotool) to provide a completely
[wtype](https://github.com/atx/wtype) to provide a completely
Wayland-native way to conveniently use [pass](https://www.passwordstore.org/).
It provides the same search that `passmenu` does, but shows a second dialogue
that lets the user choose which field to copy/print.

12
wofi-pass

@ -1,5 +1,7 @@
#!/usr/bin/env bash
TYPE_CMD="wtype -"
_trim() {
local var="$*"
# remove leading whitespace characters
@ -101,11 +103,11 @@ if [[ $typeit -eq 0 ]]; then
wl-copy "$(_pass_get $field)"
else
if [[ $field == "autotype" ]] || [[ $autotype -eq 1 ]]; then
_pass_get "username" | ydotool type --file -
printf "\t" | ydotool type --file -
_pass_get "password" | ydotool type --file -
printf "\n" | ydotool type --file -
_pass_get "username" | ${TYPE_CMD}
printf "\t" | ${TYPE_CMD}
_pass_get "password" | ${TYPE_CMD}
printf "\n" | ${TYPE_CMD}
else
_pass_get $field | ydotool type --file -
_pass_get $field | ${TYPE_CMD}
fi
fi

Loading…
Cancel
Save