Some lappy changes
This commit is contained in:
parent
dc40c281e1
commit
d744bb7a31
7 changed files with 77 additions and 23 deletions
50
scripts/rrbw
Executable file
50
scripts/rrbw
Executable file
|
@ -0,0 +1,50 @@
|
|||
#!/usr/bin/env bash
|
||||
# Very basic Rofi RBW finder
|
||||
|
||||
prompt='search for passwords...'
|
||||
ENTRY=$(rbw-list | rofi --prompt="${prompt}" -dmenu)
|
||||
SECRET=$(rbw get $ENTRY)
|
||||
|
||||
# Ask whether pass, user or both are required
|
||||
|
||||
options=("Password" \
|
||||
"User" \
|
||||
"User and password" \
|
||||
"QR-Code" \
|
||||
"OTP")
|
||||
|
||||
option=$(printf '%s\n' "${options[@]%}" | rofi -dmenu --width 400 --lines 4 --prompt="..." --cache-file /dev/null)
|
||||
|
||||
echo $option
|
||||
|
||||
case ${option} in
|
||||
Password )
|
||||
echo "Test"
|
||||
wtype $(pass ${SECRET} | head -n 1)
|
||||
;;
|
||||
User )
|
||||
wtype $(pass ${SECRET} | rg user: | 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)
|
||||
;;
|
||||
"QR-Code" )
|
||||
if [[ $SECRET =~ wifi$ ]]; then
|
||||
# Produce a valid wifi QR-code
|
||||
WIFISSID=$(pass get_user ${SECRET})
|
||||
WIFIPASS=$(pass get_pass ${SECRET})
|
||||
WIFIQR="WIFI:T:WPA;S:${WIFISSID};P:${WIFIPASS};;"
|
||||
qrencode -s 8 -o - $WIFIQR | feh --title "pass: QR-WIFI" -
|
||||
else
|
||||
# Only password
|
||||
pass show -q1 ${SECRET}
|
||||
fi
|
||||
;;
|
||||
"OTP" )
|
||||
wtype $(pass otp ${SECRET})
|
||||
;;
|
||||
esac
|
||||
|
||||
# wl-copy -o -s ${seat} ${PASSWD_PASS}
|
Loading…
Add table
Add a link
Reference in a new issue