15 lines
499 B
Bash
Executable file
15 lines
499 B
Bash
Executable file
#!/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
|
|
|