WiFi: connect OWE-TM/open networks without OWE, no lock icon
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5234d6373d
commit
b5874f23ba
1 changed files with 16 additions and 3 deletions
|
|
@ -102,7 +102,17 @@ in
|
||||||
'';
|
'';
|
||||||
wifiConnectScript = pkgs.writeShellScript "wifi-connect" ''
|
wifiConnectScript = pkgs.writeShellScript "wifi-connect" ''
|
||||||
ssid="$1"
|
ssid="$1"
|
||||||
${pkgs.networkmanager}/bin/nmcli device wifi connect "$ssid" 2>/dev/null && exit 0
|
nmcli=${pkgs.networkmanager}/bin/nmcli
|
||||||
|
# Open or OWE-TM (open with an OWE twin, common at airports):
|
||||||
|
# `device wifi connect` builds a key-mgmt=owe profile for OWE-TM,
|
||||||
|
# which the Macbook's wl driver can't do, so it times out. A profile
|
||||||
|
# with no wifi-sec is valid for OWE-TM, so build that by hand.
|
||||||
|
case "$2" in *WEP*|*WPA*) ;; *)
|
||||||
|
$nmcli connection delete id "$ssid" 2>/dev/null
|
||||||
|
$nmcli connection add type wifi con-name "$ssid" ssid "$ssid" >/dev/null
|
||||||
|
exec $nmcli connection up id "$ssid" ;;
|
||||||
|
esac
|
||||||
|
$nmcli device wifi connect "$ssid" 2>/dev/null && exit 0
|
||||||
pw=$(${pkgs.zenity}/bin/zenity --password --title="WiFi Password" 2>/dev/null)
|
pw=$(${pkgs.zenity}/bin/zenity --password --title="WiFi Password" 2>/dev/null)
|
||||||
[ -n "$pw" ] && ${pkgs.networkmanager}/bin/nmcli device wifi connect "$ssid" password "$pw"
|
[ -n "$pw" ] && ${pkgs.networkmanager}/bin/nmcli device wifi connect "$ssid" password "$pw"
|
||||||
'';
|
'';
|
||||||
|
|
@ -3930,7 +3940,8 @@ in
|
||||||
Process {
|
Process {
|
||||||
id: wifiConnectProc
|
id: wifiConnectProc
|
||||||
property string targetSsid: ""
|
property string targetSsid: ""
|
||||||
command: [Commands.wifiConnect, targetSsid]
|
property string targetSecurity: ""
|
||||||
|
command: [Commands.wifiConnect, targetSsid, targetSecurity]
|
||||||
}
|
}
|
||||||
|
|
||||||
Process {
|
Process {
|
||||||
|
|
@ -5155,6 +5166,7 @@ in
|
||||||
onClicked: {
|
onClicked: {
|
||||||
if (!modelData.active) {
|
if (!modelData.active) {
|
||||||
wifiConnectProc.targetSsid = modelData.ssid;
|
wifiConnectProc.targetSsid = modelData.ssid;
|
||||||
|
wifiConnectProc.targetSecurity = modelData.security;
|
||||||
wifiConnectProc.running = true;
|
wifiConnectProc.running = true;
|
||||||
netRefreshDelay.start();
|
netRefreshDelay.start();
|
||||||
}
|
}
|
||||||
|
|
@ -5195,7 +5207,8 @@ in
|
||||||
}
|
}
|
||||||
|
|
||||||
SIcon {
|
SIcon {
|
||||||
visible: modelData.security !== "" && modelData.security !== "--"
|
// OWE-TM is open to anyone; only WEP/WPA need a password.
|
||||||
|
visible: /WEP|WPA/.test(modelData.security)
|
||||||
text: "lock"
|
text: "lock"
|
||||||
color: Theme.base03
|
color: Theme.base03
|
||||||
font.pixelSize: 13
|
font.pixelSize: 13
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue