summaryrefslogtreecommitdiffstats
path: root/polybar/Linux-wifi.sh
diff options
context:
space:
mode:
Diffstat (limited to 'polybar/Linux-wifi.sh')
-rwxr-xr-xpolybar/Linux-wifi.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/polybar/Linux-wifi.sh b/polybar/Linux-wifi.sh
new file mode 100755
index 0000000..90cad68
--- /dev/null
+++ b/polybar/Linux-wifi.sh
@@ -0,0 +1,12 @@
+#!/usr/bin/env bash
+
+while true; do
+ WIFI_STATUS=$(wpa_cli status | grep wpa_state | awk -F'=' '{print $2}')
+ if [[ "$WIFI_STATUS" == "DISCONNECTED" ]]; then
+ echo 'Not connected'
+ else
+ WIFI_NAME=$(wpa_cli status | grep ssid | awk -F'=' '{print $2}')
+ echo "$WIFI_NAME"
+ fi
+ sleep 60
+done