move to wtype

This commit is contained in:
Joel Beckmeyer 2021-07-13 21:13:36 -04:00
parent 8305359a9a
commit e4e520f6f6
2 changed files with 8 additions and 6 deletions

View File

@ -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.

View File

@ -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