13 lines
404 B
Bash
Executable File
13 lines
404 B
Bash
Executable File
#!/run/current-system/sw/bin/bash
|
|
|
|
# Get a list of available Wi-Fi networks
|
|
networks=$(nmcli -t -f SSID device wifi list)
|
|
|
|
# Show the list using wofi with dmenu mode
|
|
selected=$(echo "$networks" | wofi --show dmenu --width=300 --height=500 --prompt="Select a network")
|
|
|
|
# Connect to the selected network with the --ask option
|
|
if [ -n "$selected" ]; then
|
|
nmcli --ask device wifi connect "$selected"
|
|
fi
|