From 54b772cae06eb25adf33297e35234f33ded81a7b Mon Sep 17 00:00:00 2001 From: Saumit Dinesan Date: Sat, 12 Mar 2022 19:54:51 +0530 Subject: neovim addition --- .scripts/wifi-menu-custom | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) create mode 100755 .scripts/wifi-menu-custom (limited to '.scripts/wifi-menu-custom') diff --git a/.scripts/wifi-menu-custom b/.scripts/wifi-menu-custom new file mode 100755 index 0000000..db2fced --- /dev/null +++ b/.scripts/wifi-menu-custom @@ -0,0 +1,22 @@ +#!/bin/sh + +choice=$(echo -e "up\ndown\nconnect" | dmenu -p "Do you wish to connect to a wi-fi or disconnect?:") + +case $choice in + "connect") + bssid=$(nmcli device wifi list | sed -n '1!p' | cut -b 9- | dmenu -p "Select Wifi  " -l 20 | cut -d' ' -f1) + pass=$(echo "" | dmenu -p "Enter Pswd  ") + nmcli device wifi $choice $bssid password $pass;; + "up" | "down") + ssid=$(nmcli device wifi list | sed -n '1!p' | cut -b 9- | dmenu -p "Select Wifi  " -l 20 | cut -d' ' -f3) + nmcli c $choice $ssid;; +esac +wifistatus=$(nmcli d | grep wlan0 | cut -d ' ' -f10) +case $wifistatus in + "connected") + nmcli con down eth0 "Wired connection 1";; + "disconnected") + nmcli con up eth0 "Wired connection 1";; +esac +ethstatus=$(nmcli d | grep eth0 | cut -d ' ' -f7) +notify-send "Ethernet connection is $ethstatus" -- cgit v1.2.3