fix(hyprland): register portal once

This commit is contained in:
Barrett Ruth 2026-02-15 01:34:58 -05:00
parent 217b81c877
commit 4729625193
Signed by: barrett
GPG key ID: A6C96C9349D2FC81
5 changed files with 16 additions and 89 deletions

View file

@ -176,7 +176,16 @@ wifi)
count=$(printf '%s\n' "$networks" | wc -l)
ssid=$(printf '%s\n' "$networks" | fuzzel --dmenu --prompt="wifi: " --no-icons --lines="$count")
[ -z "$ssid" ] && exit 0
iwctl station "$station" connect "$ssid"
known=$(iwctl known-networks list 2>/dev/null | sed 's/\x1b\[[0-9;]*[a-zA-Z]//g')
if printf '%s' "$known" | grep -qF "$ssid"; then
iwctl station "$station" connect "$ssid"
elif iwctl station "$station" get-networks 2>/dev/null | sed 's/\x1b\[[0-9;]*[a-zA-Z]//g' | grep -F "$ssid" | grep -qi "open"; then
iwctl station "$station" connect "$ssid"
else
pass=$(printf '' | fuzzel --dmenu --prompt="passphrase: " --no-icons --password --lines=0)
[ -z "$pass" ] && exit 0
iwctl station "$station" connect "$ssid" --passphrase "$pass"
fi
;;
*)
echo "Usage: ctl wifi {pick}" >&2