Files
nixos/Droidnix_v2/assets/system/scripts/networking_in_wofi.sh
T
2026-03-23 16:18:38 +00:00

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