I got a little crazy here. a lot of laptop poop

This commit is contained in:
Chris Cochrun 2021-09-22 09:58:13 -05:00
parent 263d10c080
commit fab3b36dec
47 changed files with 3726 additions and 189 deletions

View file

@ -1,16 +1,29 @@
#!/usr/bin/env bash
# Very basic interface for rbw using rofi
if [ $(hostname) = "syl" ]; then
style="laptop-rbw"
#echo "this is hidpi"
else
style="desktop-rbw"
#echo "this is not hidpi"
fi
# Get all password files and create an array
root=~/.password-store
CACHE=~/.local/tmp/pass_rofi
seat=seat0
rbw sync
rbw list
list_passwords() {
rbw list
}
passwords=$(rbw list)
prompt='search for passwords...'
SECRET=$(list_passwords | rofi -i -p="${prompt}" -dmenu)
SECRET=$(list_passwords | wofi -i -p"${prompt}" -d)
# Ask whether pass, user or both are required
options=("Password" \
@ -19,22 +32,22 @@ options=("Password" \
"QR-Code" \
"OTP")
option=$(printf '%s\n' "${options[@]%}" | rofi -i -dmenu -width 400 -lines 4 -prompt="...")
option=$(printf '%s\n' "${options[@]%}" | wofi -id -W 400 -H 150 -p"...")
# echo $option
case ${option} in
Password )
# echo "${SECRET}"
wtype $(rbw get "${SECRET}")
ydotool type $(rbw get "${SECRET}")
;;
User )
wtype $(rbw get --full "${SECRET}" | rg Username: | awk '{$1 = ""; print $0}')
ydotool type $(rbw get --full "${SECRET}" | rg Username: | awk '{$1 = ""; print $0}')
;;
"User and password" )
wtype $(rbw get --full "${SECRET}" | rg Username: | awk '{$1 = ""; print $0}')
wtype -k TAB
wtype $(rbw get "${SECRET}")
ydotool type $(rbw get --full "${SECRET}" | rg Username: | awk '{$1 = ""; print $0}')
ydotool key TAB
ydotool type $(rbw get "${SECRET}")
;;
"QR-Code" )
if [[ $SECRET =~ wifi$ ]]; then
@ -49,7 +62,7 @@ case ${option} in
fi
;;
"OTP" )
wtype $(rbw code ${SECRET})
ydotool type $(rbw code ${SECRET})
;;
esac