dotfiles/.local/bin/wlp
2025-01-30 13:55:36 +00:00

17 lines
359 B
Bash
Executable File

#!/bin/bash -e
iwctl=(iwctl station "$(basename /sys/class/net/wlan*)")
rfkill unblock wlan
if ! "${iwctl[@]}" show | grep -q 'Scanning\s\+yes'; then
"${iwctl[@]}" scan
fi
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