I got a little crazy here. a lot of laptop poop
This commit is contained in:
parent
263d10c080
commit
fab3b36dec
47 changed files with 3726 additions and 189 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue