Initial Commit
This commit is contained in:
Executable
+18
@@ -0,0 +1,18 @@
|
||||
#!/bin/bash
|
||||
# TO CONNECT TO WIFI USING DMENU | ROFI WHICH IS CONNECTED BEFORE
|
||||
# bssid=$(nmcli device wifi list | sed -n '1!P'| cut -b 9- | dmenu -p "Wifi" -l 10 | awk '{print $1}')
|
||||
|
||||
dir="$HOME/.config/wofi"
|
||||
theme='style-1'
|
||||
|
||||
# [ -z "$bssid" ] && exit 1
|
||||
# nmcli device wifi connect $bssid
|
||||
# notify-send "📶 WiFi Connected"
|
||||
|
||||
bssid=$(nmcli device wifi list | sed -n '1!P'| cut -b 9- | wofi --dmenu --style ${dir}/${theme}.css -p " " --lines 10 | awk '{print $1}')
|
||||
[ -z "$bssid" ] && exit 1
|
||||
if nmcli device wifi connect "$bssid"; then
|
||||
notify-send "📶 WiFi Connected" "Successfully connected to network."
|
||||
else
|
||||
notify-send -u critical "⚠️ WiFi Error" "Failed to connect to network."
|
||||
fi
|
||||
Executable
+22
@@ -0,0 +1,22 @@
|
||||
#!/bin/bash
|
||||
# SCRIPT TO CONNECT TO NEW WIFI USING DMENU | ROFI
|
||||
|
||||
dir="$HOME/.config/wofi"
|
||||
theme='style-1'
|
||||
|
||||
# bssid=$(nmcli device wifi list | sed -n '1!P'| cut -b 9- | dmenu -p "Wifi" -l 10 | awk '{print $1}')
|
||||
# [ -z "$bssid" ] && exit 1
|
||||
# pass=$(echo "" | dmenu -p "Enter password")
|
||||
# [ -z "$pass" ] && notify-send "🔑 Password not enterd" && exit 1
|
||||
# nmcli device wifi connect $bssid password $pass
|
||||
# notify-send "📶 New WiFi Connected"
|
||||
|
||||
bssid=$(nmcli device wifi list | sed -n '1!P' | cut -b 9- | wofi --dmenu --style ${dir}/${theme}.css -p " " --lines 10 | awk '{print $1}')
|
||||
[ -z "$bssid" ] && exit 1
|
||||
pass=$(echo "" | wofi --dmenu --style ${dir}/${theme}.css -p " Enter password" --password)
|
||||
[ -z "$pass" ] && notify-send "🔑 Password not entered" && exit 1
|
||||
if nmcli device wifi connect "$bssid" password "$pass"; then
|
||||
notify-send "📶 New WiFi Connected" "Successfully connected to network."
|
||||
else
|
||||
notify-send -u critical "⚠️ WiFi Error" "Failed to connect to network."
|
||||
fi
|
||||
Reference in New Issue
Block a user