WIP new top level flakes break down

This commit is contained in:
RingOfStorms (Joshua Bell) 2025-10-20 20:45:26 -05:00
parent 2238aaf367
commit 7215fd37bf
57 changed files with 3033 additions and 69 deletions

View file

@ -0,0 +1,24 @@
#!/usr/bin/env bash
# Get a list of available Wi-Fi networks
nets=$(nmcli --terse --fields SSID,SECURITY,BARS device wifi list | sed '/^--/d' | sed 's/\\:/__/g')
# Get the current connection status
connected_ssid=$(nmcli -t -f active,ssid dev wifi | egrep '^yes' | cut -d: -f2)
if [[ ! -z "$connected_ssid" ]]; then
toggle="󰖪 Toggle Wi-Fi Off"
else
toggle="󰖩 Toggle Wi-Fi On"
fi
# Present the menu to the user
chosen_network=$(echo -e "$toggle\n$nets" | wofi --dmenu --location 3 --yoffset 40 --xoffset -20 -p "Wi-Fi Networks")
# Perform an action based on the user's choice
if [ "$chosen_network" = "$toggle" ]; then
nmcli radio wifi $([ "$connected_ssid" = "" ] && echo "on" || echo "off")
elif [ ! -z "$chosen_network" ]; then
ssid=$(echo "$chosen_network" | sed 's/__/\\:/g' | awk -F' ' '{print $1}')
nmcli device wifi connect "$ssid"
fi