Some nyxt changes, rbw and pass changes.

This commit is contained in:
Chris Cochrun 2021-07-05 13:16:34 -05:00
parent 71151f755f
commit c813c61938
10 changed files with 174 additions and 31 deletions

5
scripts/rbw-rofi Executable file
View file

@ -0,0 +1,5 @@
#!/bin/bash
set -eu
set -o pipefail
rbw ls --fields folder,name,user | sed 's/\t/\//g' | sort | rofi -dmenu | sed 's/^[^\/]*\///' | sed 's/\// /' | xargs -r rbw get | xclip -l 1

View file

@ -1,9 +1,17 @@
#!/usr/bin/env bash
# Very basic Rofi RBW finder
# Very basic interface for pass using rofi
# Get all password files and create an array
root=~/.password-store
CACHE=~/.local/tmp/pass_rofi
seat=seat0
list_passwords() {
rbw list
}
prompt='search for passwords...'
ENTRY=$(rbw-list | rofi --prompt="${prompt}" -dmenu)
SECRET=$(rbw get $ENTRY)
SECRET=$(list_passwords | rofi -i -p="${prompt}" -dmenu)
# Ask whether pass, user or both are required
@ -13,22 +21,22 @@ options=("Password" \
"QR-Code" \
"OTP")
option=$(printf '%s\n' "${options[@]%}" | rofi -dmenu --width 400 --lines 4 --prompt="..." --cache-file /dev/null)
option=$(printf '%s\n' "${options[@]%}" | rofi -i -dmenu -width 400 -lines 4 -prompt="...")
echo $option
case ${option} in
Password )
echo "Test"
wtype $(pass ${SECRET} | head -n 1)
xdotool type $(rbw get ${SECRET})
;;
User )
wtype $(pass ${SECRET} | rg user: | awk '{$1 = ""; print $0}')
xdotool type $(rbw get --full ${SECRET} | rg Username: | awk '{$1 = ""; print $0}')
;;
"User and password" )
wtype $(pass ${SECRET} | rg user: | awk '{$1 = ""; print $0}')
wtype -k TAB
wtype $(pass ${SECRET} | head -n 1)
xdotool type $(rbw get --full ${SECRET} | rg Username: | awk '{$1 = ""; print $0}')
xdotool key Tab
xdotool type $(rbw get ${SECRET})
;;
"QR-Code" )
if [[ $SECRET =~ wifi$ ]]; then
@ -43,7 +51,7 @@ case ${option} in
fi
;;
"OTP" )
wtype $(pass otp ${SECRET})
xdotool type $(rbw code ${SECRET})
;;
esac