about summary refs log tree commit diff
path: root/.local/bin/rofi-wifimenu
diff options
context:
space:
mode:
authorvenomade <venomade@venomade.com>2026-02-16 17:31:16 +0000
committervenomade <venomade@venomade.com>2026-02-16 17:31:16 +0000
commita568a964fd6a9efba388b2b4919339c0b7dfe51d (patch)
tree0c6adbf753de1c0b469e911668a82c6b2002f5f8 /.local/bin/rofi-wifimenu
parent9d2c3f898a97de16b986d4e494f31e6c6f3d176a (diff)
MacOS Nix HEAD master
Asahi is just not perfectly usable yet.
Moved stuff, went nix.
Diffstat (limited to '.local/bin/rofi-wifimenu')
-rwxr-xr-x.local/bin/rofi-wifimenu38
1 files changed, 0 insertions, 38 deletions
diff --git a/.local/bin/rofi-wifimenu b/.local/bin/rofi-wifimenu
deleted file mode 100755
index fb45671..0000000
--- a/.local/bin/rofi-wifimenu
+++ /dev/null
@@ -1,38 +0,0 @@
-#!/usr/bin/env bash
-
-notify-send "Getting list of available Wi-Fi networks..."
-# Get a list of available wifi connections and morph it into a nice-looking list
-wifi_list=$(nmcli --fields "SECURITY,SSID" device wifi list | sed 1d | sed 's/  */ /g' | sed -E "s/WPA*.?\S/ /g" | sed "s/^--/ /g" | sed "s/  //g" | sed "/--/d")
-
-connected=$(nmcli -fields WIFI g)
-if [[ "$connected" =~ "enabled" ]]; then
-	toggle="󰖪  Disable Wi-Fi"
-elif [[ "$connected" =~ "disabled" ]]; then
-	toggle="󰖩  Enable Wi-Fi"
-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: " )
-# Get name of connection
-read -r chosen_id <<< "${chosen_network:3}"
-
-if [ "$chosen_network" = "" ]; then
-	exit
-elif [ "$chosen_network" = "󰖩  Enable Wi-Fi" ]; then
-	nmcli radio wifi on
-elif [ "$chosen_network" = "󰖪  Disable Wi-Fi" ]; then
-	nmcli radio wifi off
-else
-	# Message to show when connection is activated successfully
-  	success_message="You are now connected to the Wi-Fi network \"$chosen_id\"."
-	# Get saved connections
-	saved_connections=$(nmcli -g NAME connection)
-	if [[ $(echo "$saved_connections" | grep -w "$chosen_id") = "$chosen_id" ]]; then
-		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: " )
-		fi
-		nmcli device wifi connect "$chosen_id" password "$wifi_password" | grep "successfully" && notify-send "Connection Established" "$success_message"
-    fi
-fi