summaryrefslogtreecommitdiff
path: root/keyboard/addnetwork
diff options
context:
space:
mode:
authorTimmy Keller <tjk@tjkeller.xyz>2021-09-11 00:36:13 -0500
committerTimmy Keller <tjk@tjkeller.xyz>2021-09-11 00:36:13 -0500
commit0a9053c2902adab8b94eaacdb15390441143078c (patch)
tree1f1a38272dbd554cde8cdec263187112b9c6a7e8 /keyboard/addnetwork
downloadscripts-0a9053c2902adab8b94eaacdb15390441143078c.tar.xz
scripts-0a9053c2902adab8b94eaacdb15390441143078c.zip
redid repo cus of fucking chromium rip old commit messages
Diffstat (limited to 'keyboard/addnetwork')
-rwxr-xr-xkeyboard/addnetwork12
1 files changed, 12 insertions, 0 deletions
diff --git a/keyboard/addnetwork b/keyboard/addnetwork
new file mode 100755
index 0000000..7918985
--- /dev/null
+++ b/keyboard/addnetwork
@@ -0,0 +1,12 @@
+#!/bin/sh
+#if ssid=`doas iw dev $wifidev scan | sed '/SSID: .\+/!d;/x00/d;s/.*SSID: //' | dmenu -p "Choose Network to Connect to: "` \
+if ssid=`doas iw dev $WIFIDEV scan | sed '/SSID: .\+/!d;/x00/d;s/.*SSID: //' | dmenu -p "Choose Network to Connect to: "` \
+&& [ -n "$ssid" ] \
+&& pass=`dmenu -p "Enter Password for $ssid: " <&-` \
+&& [ -n "$pass" ]
+then
+ wpa_passphrase "$ssid" "$pass" | doas tee -a "/etc/wpa_supplicant/wpa_supplicant.conf" \
+ && doas sv restart dhcpcd \
+ && dunstify "Network Added" "Network \"$ssid\" Added to wpa_supplicant.conf and restarted the dhcpcd service!" \
+ || dunstify "Error" "An error has occured"
+fi