Fix mistaking wireless for wired networks in polybar script
This commit is contained in:
parent
3f5e9051a9
commit
a0c0fb9289
@ -1,17 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
wireless_connected=""
|
||||
disconnected="/"
|
||||
disconnected2="\\"
|
||||
wireless_connected=""
|
||||
ethernet_connected=""
|
||||
|
||||
while true; do
|
||||
if ping -c1 8.8.8.8 &>/dev/null; then
|
||||
if [[ $(ip link | awk '/state UP/ {getline;print $1}') = link/ether ]]; then
|
||||
echo "$ethernet_connected"; sleep 10
|
||||
if [[ $(ping -c1 8.8.8.8) ]]; then
|
||||
ID=$(ip link | awk '/state UP/ {print $2}')
|
||||
if [[ ${ID[0]} == "e" ]]; then
|
||||
echo "$ethernet_connected" ; sleep 10
|
||||
else
|
||||
echo "$wireless_connected"; sleep 10
|
||||
echo "$wireless_connected" ; sleep 10
|
||||
fi
|
||||
else
|
||||
echo "$disconnected"; sleep 1
|
||||
echo "$disconnected" ; sleep 0.6
|
||||
echo "$disconnected2" ; sleep 0.6
|
||||
fi
|
||||
done
|
||||
|
Reference in New Issue
Block a user