summaryrefslogtreecommitdiff
path: root/.scripts/wifi-menu
diff options
context:
space:
mode:
authorSaumit Dinesan <justsaumit@protonmail.com>2022-08-12 07:20:44 +0530
committerSaumit Dinesan <justsaumit@protonmail.com>2022-08-12 07:20:44 +0530
commit937b269967f2ef0ac379cb8cd1d787cc91426d12 (patch)
treeaba6f183e06bf6d0e9e4a56f84dad90977281ba6 /.scripts/wifi-menu
parentc87e60e7e9f39e33dce2144d8a855f47358b84a2 (diff)
specifying bash for non-posix compliant scripts+correcting other scripts
Diffstat (limited to '.scripts/wifi-menu')
-rwxr-xr-x.scripts/wifi-menu6
1 files changed, 3 insertions, 3 deletions
diff --git a/.scripts/wifi-menu b/.scripts/wifi-menu
index dd5b9b3..4713c00 100755
--- a/.scripts/wifi-menu
+++ b/.scripts/wifi-menu
@@ -1,13 +1,13 @@
-#!/bin/sh
+#!/bin/bash
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" ;;
+ 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 ;;
+ nmcli device wifi connect "$bssid" password "$pass" ;;
esac