making more widgets and better spacing

This commit is contained in:
Chris Cochrun 2021-08-18 17:05:04 -05:00
parent ea0f4fd844
commit c27a826eb0
10 changed files with 139 additions and 83 deletions

View file

@ -11,48 +11,48 @@ list_passwords() {
}
prompt='search for passwords...'
SECRET=$(list_passwords | rofi -i -p="${prompt}" -dmenu --no-lazy-grab)
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")
options=("Password" \
"User" \
"User and password" \
"QR-Code" \
"OTP")
# option=$(printf '%s\n' "${options[@]%}" | rofi -i -dmenu -width 400 -lines 4 -prompt="...")
option=$(printf '%s\n' "${options[@]%}" | rofi -i -dmenu -width 400 -lines 4 -prompt="...")
# echo $option
echo $option
# case ${option} in
# Password )
# echo "${SECRET}"
# xdotool type $(rbw get "${SECRET}")
# ;;
# User )
# xdotool type $(rbw get --full "${SECRET}" | rg Username: | awk '{$1 = ""; print $0}')
# ;;
# "User and password" )
# 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
# # 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" )
# xdotool type $(rbw code ${SECRET})
# ;;
# esac
case ${option} in
Password )
echo "${SECRET}"
xdotool type $(rbw get "${SECRET}")
;;
User )
xdotool type $(rbw get --full "${SECRET}" | rg Username: | awk '{$1 = ""; print $0}')
;;
"User and password" )
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
# 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" )
xdotool type $(rbw code ${SECRET})
;;
esac
# # wl-copy -o -s ${seat} ${PASSWD_PASS}
# wl-copy -o -s ${seat} ${PASSWD_PASS}