From 3faa9053457b98c9f7e147c0b5b6b1c943868f25 Mon Sep 17 00:00:00 2001 From: Aminda Suomalainen Date: Sat, 21 Jan 2023 13:01:30 +0200 Subject: [PATCH] iwd-wifi.bash: simple script for scanning and how to connect to network --- bash/iwd-wifi.bash | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100755 bash/iwd-wifi.bash diff --git a/bash/iwd-wifi.bash b/bash/iwd-wifi.bash new file mode 100755 index 0000000..530e466 --- /dev/null +++ b/bash/iwd-wifi.bash @@ -0,0 +1,19 @@ +#!/usr/bin/env bash + +# A simple script to list networks iwd detects and give instruction for +# connecting to it. Heavily inspired by `man iwctl` + +# So the terminal is empty for the table +clear + +# `iwctl device list` gives the WiFi adapters +WIFIDEVICE=wlan0 + +# Scan and list results +iwctl station $WIFIDEVICE scan +iwctl station $WIFIDEVICE get-networks + +# Print the command to connect. Replace $KEY and $SSID with the actual ones +echo "% sudo iwctl --passphrase=\$KEY station $WIFIDEVICE connect \$SSID" + +# For permanent connections https://gitea.blesmrt.net/mikaela/shell-things/src/branch/master/var/lib/iwd