ericmurphyxyz / rofi-wifi-menu

A bash script using nmcli and rofi to make a wifi menu for your favorite window manager
208 stars 15 forks source link

Fix for SSIDs with special characters #9

Closed kavishkagihan closed 11 months ago

kavishkagihan commented 1 year ago

The script does not handle SSIDs with special characters like quotes well due to using xargs to select the SSID name. You can fix that by using read -r to strip the white spaces instead of xargs

# 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: " )
# Get name of connection
read -r chosen_id <<< "${chosen_network:3}"

PS: I have already made some changes to the notify-send to increase the font size a little bit.