bwzy/bwzy-autofill

31 lines
703 B
Text
Raw Normal View History

2025-03-19 23:13:18 -06:00
#!/bin/bash
# Read up to the first three lines from standard input
read -r USER || USER=""
read -r PASS || PASS=""
read -r TOTP || TOTP=""
# Get the last active window
#LAST_WINDOW=$(hyprctl clients | grep ^Window | tail -n1 | awk '{print $2}')
# Focus last window
$BWZY_REFOCUS_CMD
2025-04-03 14:51:14 -06:00
# Hide bwzy
$BWZY_HIDE_CMD
2025-03-19 23:13:18 -06:00
# Use wtype to output the USER and PASS
$BWZY_TYPE_CMD "$USER"
$BWZY_TYPE_CMD " "
$BWZY_TYPE_CMD "$PASS"
$BWZY_TYPE_CMD " "
$BWZY_TYPE_CMD $'\n'
[[ -n "$BWZY_NOTIFY_CMD" ]] && $BWZY_NOTIFY_CMD "user & pass autofilled"
# Copy the TOTP to clipboard
if [[ -n "$TOTP" ]]; then
echo -n "$TOTP" | cli-copy
[[ -n "$BWZY_NOTIFY_CMD" ]] && $BWZY_NOTIFY_CMD "TOTP copied to clipboard"
fi
2025-04-03 14:51:14 -06:00