dotfiles/.local/bin/wlp
2024-06-23 11:51:38 +02:00

14 lines
295 B
Bash
Executable File

#!/bin/bash -e
iwctl=(iwctl station wlan0)
"${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 -36 "$(cat "$HOME/.cache/pidofbar")"
exit 0
fi
sleep 1
done