aboutsummaryrefslogtreecommitdiff
path: root/config/polybar/hack/scripts/check-network
diff options
context:
space:
mode:
authorAnhgelus Morhtuuzh <anhgelus.morhtuuzh@gmx.com>2023-07-25 23:46:05 +0200
committerAnhgelus Morhtuuzh <anhgelus.morhtuuzh@gmx.com>2023-07-25 23:46:05 +0200
commitc57e8ab185623510e527400a34d729b313daffc4 (patch)
tree7b67d44894255ce4810d8074d68fce88f66d37d0 /config/polybar/hack/scripts/check-network
parent9f004955033387eebf3f58aec2501fba5020f307 (diff)
feat(polybar): update polybar style
Diffstat (limited to 'config/polybar/hack/scripts/check-network')
-rwxr-xr-xconfig/polybar/hack/scripts/check-network19
1 files changed, 19 insertions, 0 deletions
diff --git a/config/polybar/hack/scripts/check-network b/config/polybar/hack/scripts/check-network
new file mode 100755
index 0000000..53ba282
--- /dev/null
+++ b/config/polybar/hack/scripts/check-network
@@ -0,0 +1,19 @@
+#!/usr/bin/env bash
+
+count=0
+connected="說"
+disconnected="ﲁ"
+
+ID="$(ip link | awk '/state UP/ {print $2}')"
+
+while true; do
+ if (ping -c 1 archlinux.org || ping -c 1 google.com || ping -c 1 bitbucket.org || ping -c 1 github.com || ping -c 1 sourceforge.net) &>/dev/null; then
+ if [[ $ID == e* ]]; then
+ echo "$connected Online" ; sleep 25
+ else
+ echo "$connected Online" ; sleep 25
+ fi
+ else
+ echo "$disconnected Offline" ; sleep 5
+ fi
+done