more scripts
This commit is contained in:
parent
d25a75a078
commit
ea0f4fd844
7 changed files with 301 additions and 0 deletions
56
scripts/wlrofi-rbw
Executable file
56
scripts/wlrofi-rbw
Executable file
|
@ -0,0 +1,56 @@
|
|||
#!/usr/bin/env bash
|
||||
# Very basic interface for rbw using rofi
|
||||
|
||||
# Get all password files and create an array
|
||||
CACHE=~/.local/tmp/pass_rofi
|
||||
seat=seat0
|
||||
|
||||
list_passwords() {
|
||||
rbw list
|
||||
}
|
||||
|
||||
prompt='search for passwords...'
|
||||
SECRET=$(list_passwords | rofi -i -p="${prompt}" -dmenu)
|
||||
|
||||
# Ask whether pass, user or both are required
|
||||
options=("Password" \
|
||||
"User" \
|
||||
"User and password" \
|
||||
"QR-Code" \
|
||||
"OTP")
|
||||
|
||||
option=$(printf '%s\n' "${options[@]%}" | rofi -i -dmenu -width 400 -lines 4 -prompt="...")
|
||||
|
||||
# echo $option
|
||||
|
||||
case ${option} in
|
||||
Password )
|
||||
# echo "${SECRET}"
|
||||
wtype $(rbw get "${SECRET}")
|
||||
;;
|
||||
User )
|
||||
wtype $(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}")
|
||||
;;
|
||||
"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 $(rbw code ${SECRET})
|
||||
;;
|
||||
esac
|
||||
|
||||
# wl-copy -o -s ${seat} ${PASSWD_PASS}
|
Loading…
Add table
Add a link
Reference in a new issue