summaryrefslogtreecommitdiff
path: root/network-status
diff options
context:
space:
mode:
Diffstat (limited to 'network-status')
-rwxr-xr-xnetwork-status27
1 files changed, 27 insertions, 0 deletions
diff --git a/network-status b/network-status
new file mode 100755
index 0000000..ae54aeb
--- /dev/null
+++ b/network-status
@@ -0,0 +1,27 @@
+#!/bin/sh
+
+status="$(nmcli general status | grep -oh "\w*connect\w*")"
+
+if [[ "$status" == "disconnected" ]]; then
+ printf "󰤮 "
+elif [[ "$status" == "connecting" ]]; then
+ printf "󱍸 "
+elif [[ "$status" == "connected" ]]; then
+ # strength="$(nmcli -f IN-USE,SIGNAL device wifi | grep '*' | awk '{print $2}')"
+ strength="$(python $HOME/scripts/wifi-conn-strength)"
+ if [[ "$?" == "0" ]]; then
+ if [[ "$strength" -eq "0" ]]; then
+ printf "󰤯 "
+ elif [[ ("$strength" -ge "0") && ("$strength" -le "25") ]]; then
+ printf "󰤟 "
+ elif [[ ("$strength" -ge "25") && ("$strength" -le "50") ]]; then
+ printf "󰤢 "
+ elif [[ ("$strength" -ge "50") && ("$strength" -le "75") ]]; then
+ printf "󰤥 "
+ elif [[ ("$strength" -ge "75") && ("$strength" -le "100") ]]; then
+ printf "󰤨 "
+ fi
+ else
+ printf "󰈀 "
+ fi
+fi