Update .config/polybar/scripts/wifi-menu.sh

This commit is contained in:
punkfairie 2024-07-28 18:07:59 -07:00
parent 17464d3b42
commit d37e12e84b
Signed by: punkfairie
GPG key ID: A86AF57F837E320F

View file

@ -12,9 +12,9 @@ elif [[ "$connected" =~ "disabled" ]]; then
fi
# Use rofi to select wifi network
chosen_network=$(echo -e "$toggle\n$wifi_list" | uniq -u | rofi -dmenu -i -selected-row 1 -p "Wi-Fi SSID: " -theme ~/.config/polybar/mytheme/scripts/rofi/powermenu.rasi)
chosen_network=$(echo -e "$toggle\n$wifi_list" | uniq -u | rofi -dmenu -i -selected-row 1 -p "Wi-Fi SSID: " -theme ~/.config/polybar/scripts/rofi/powermenu.rasi)
# Get name of connection
read -r chosen_id <<< "${chosen_network:3}"
read -r chosen_id <<<"${chosen_network:3}"
if [ "$chosen_network" = "" ]; then
exit
@ -31,9 +31,8 @@ else
nmcli connection up id "$chosen_id" | grep "successfully" && notify-send "Connection Established" "$success_message"
else
if [[ "$chosen_network" =~ "" ]]; then
wifi_password=$(rofi -dmenu -p "Password: " -theme ~/.config/polybar/colorblocks/scripts/rofi/launcher.rasi)
wifi_password=$(rofi -dmenu -p "Password: " -theme ~/.config/polybar/scripts/rofi/launcher.rasi)
fi
nmcli device wifi connect "$chosen_id" password "$wifi_password" | grep "successfully" && notify-send "Connection Established" "$success_message"
fi
fi