From 43da6f9a4a3718f322e0c291b218cebf62504c1f Mon Sep 17 00:00:00 2001 From: John Mertz Date: Fri, 23 Sep 2022 18:26:56 -0400 Subject: [PATCH] Clean up some unneeded variables --- wofi/wofi-wifi-menu.sh | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/wofi/wofi-wifi-menu.sh b/wofi/wofi-wifi-menu.sh index 0838c4b..40c00ab 100755 --- a/wofi/wofi-wifi-menu.sh +++ b/wofi/wofi-wifi-menu.sh @@ -18,10 +18,6 @@ else fi LIST=$(nmcli --fields "$FIELDS" device wifi list | sed '/^--/d') -# For some reason wofi always approximates character width 2 short... hmmm -RWIDTH=$(($(echo "$LIST" | head -n 1 | awk '{print length($0); }')*10)) -# Dynamically change the height of the wofi menu -LINENUM=$(echo "$LIST" | wc -l) # Gives a list of known connections so we can parse it later KNOWNCON=$(nmcli connection show) # Really janky way of telling if there is currently a connection @@ -33,22 +29,12 @@ if [[ ! -z $CURRSSID ]]; then HIGHLINE=$(echo "$(echo "$LIST" | awk -F "[ ]{2,}" '{print $1}' | grep -Fxn -m 1 "$CURRSSID" | awk -F ":" '{print $1}') + 1" | bc ) fi -# HOPEFULLY you won't need this as often as I do -# If there are more than 8 SSIDs, the menu will still only have 8 lines -if [ "$LINENUM" -gt 8 ] && [[ "$CONSTATE" =~ "enabled" ]]; then - LINENUM=8 -elif [[ "$CONSTATE" =~ "disabled" ]]; then - LINENUM=1 -fi - - if [[ "$CONSTATE" =~ "enabled" ]]; then TOGGLE="toggle off" elif [[ "$CONSTATE" =~ "disabled" ]]; then TOGGLE="toggle on" fi - CHENTRY=$(echo -e "$TOGGLE\nmanual\n$LIST" | uniq -u | wofi -s $HOME/.dotfiles/wofi/style.css -i -d --prompt "Wi-Fi SSID: " -c $HOME/.dotfiles/wofi/sidebar) if [[ $CHENTRY == "" ]]; then exit