16 lines
499 B
Bash
16 lines
499 B
Bash
![]() |
#!/usr/bin/env bash
|
||
|
|
||
|
notify-send "Scanning Wi-Fi Networks"
|
||
|
|
||
|
active_wifi=$(nmcli -t -f active,ssid dev wifi | grep '^yes' | cut -d':' -f2)
|
||
|
|
||
|
wifi_list=$(nmcli --fields "SECURITY,SSID" device wifi list | sed 1d | sed 's/ */ /g' | sed -E "s/WPA*.?\S/ /g" | sed "s/^--/ /g" | sed "s/ //g" | sed "/--/d")
|
||
|
|
||
|
connected=$(nmcli -fields WIFI g)
|
||
|
if [[ "$connected" =~ "enabled" ]]; then
|
||
|
toggle=" Disable Wi-Fi"
|
||
|
elif [[ "$connected" =~ "disabled" ]]; then
|
||
|
toggle=" Enable Wi-Fi"
|
||
|
fi
|
||
|
|