Subject: [PATCH sxmo-utils v5 3/8] Autocomplete WPA networks with scanned ones

From: Reed Wade <[email-masked]>
Date: Sat, 10 Oct 2020 15:59:30 +0200

Signed-off-by: Reed Wade <[email-masked]>
---
 scripts/core/sxmo_networks.sh | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/scripts/core/sxmo_networks.sh b/scripts/core/sxmo_networks.sh
index ab19bc9..771a833 100755
--- a/scripts/core/sxmo_networks.sh
+++ b/scripts/core/sxmo_networks.sh
@@ -54,8 +54,9 @@ addnetworkgsmmenu() {
 
 addnetworkwpamenu() {
 	SSID="$(
-		echo "Close Menu" |
-			sxmo_dmenu_with_kb.sh -c -p "Add WPA: SSID" -fn "Terminus-20" -l 20
+		nmcli d wifi list | tail -n +2 | grep -v '^*' | awk '{ print $2 }' | grep -v '\-\-' |
+		xargs -0 printf 'Close Menu\n%s' |
+		sxmo_dmenu_with_kb.sh -c -p "Add WPA: SSID" -fn "Terminus-20" -l 20
 	)"
 	[ "$SSID" = "Close Menu" ] && return
 
-- 
2.28.0