dotfiles/.local/bin/wlp
2024-10-01 13:47:31 +07:00

15 lines
315 B
Bash
Executable File

#!/bin/bash -e
iwctl=(iwctl station wlan0)
rfkill unblock wlan
"${iwctl[@]}" show | grep -q 'Scanning\s\+yes' || "${iwctl[@]}" scan
for _ in {0..29}; do
if "${iwctl[@]}" show | grep -q '\s*State\s\+connected\s*$'; then
kill -37 "$(cat "$HOME/.cache/pidofbar")"
exit 0
fi
sleep 1
done