From dc1e293d6cfc51e05c5aaf39635e0a74eec6392e Mon Sep 17 00:00:00 2001 From: Matthias Johnson Date: Wed, 19 Mar 2025 23:13:18 -0600 Subject: [PATCH] initial commit --- bwzy-autofill | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100755 bwzy-autofill diff --git a/bwzy-autofill b/bwzy-autofill new file mode 100755 index 0000000..10a58ff --- /dev/null +++ b/bwzy-autofill @@ -0,0 +1,28 @@ +#!/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 +#echo "LAST_WINDOW: $LAST_WINDOW" +#hyprctl dispatch focuswindow "address:$LAST_WINDOW" +$BWZY_REFOCUS_CMD + +# 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