diff options
author | Saumit Dinesan <justsaumit@protonmail.com> | 2022-03-12 19:54:51 +0530 |
---|---|---|
committer | Saumit Dinesan <justsaumit@protonmail.com> | 2022-03-12 19:54:51 +0530 |
commit | 54b772cae06eb25adf33297e35234f33ded81a7b (patch) | |
tree | f287ee48faa8013e4a8f0ee764a6d3cd850bb24d /.scripts/wifi-menu | |
parent | 7197e45d94dbcf4877d585fff8e634896876ae83 (diff) |
neovim addition
Diffstat (limited to '.scripts/wifi-menu')
-rwxr-xr-x | .scripts/wifi-menu | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/.scripts/wifi-menu b/.scripts/wifi-menu new file mode 100755 index 0000000..dd5b9b3 --- /dev/null +++ b/.scripts/wifi-menu @@ -0,0 +1,13 @@ +#!/bin/sh + +choice=$(echo -e "up\ndown\nconnect" | dmenu -p "Do you wish to connect to a wi-fi or disconnect?:") + +case $choice in + "up"|"down") + ssid=$(nmcli -t -f ssid dev wifi| cut -d\' -f2 | dmenu -p "Select Wifi " -l 20) + nmcli c $choice "$ssid" ;; + "connect") + bssid=$(nmcli device wifi list | sed -n '1!p' | cut -b 9- | dmenu -p "Select Wi-Fi :" -l 20 | cut -d' ' -f1) + pass=$(echo "" | dmenu -P -p "Enter Password : ") + nmcli device wifi connect $bssid password $pass ;; +esac |