overwrite wifi display if ethernet connected

This commit is contained in:
Alexander Bocken 2023-10-17 11:36:07 +02:00
parent 184d26c50c
commit 9f8b1987cd
Signed by: Alexander
GPG Key ID: 1D237BE83F9B05E8
2 changed files with 4 additions and 4 deletions

View File

@ -21,10 +21,10 @@ esac
if [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'up' ] ; then
wifiicon="$(awk '/^\s*w/ { print "" }' /proc/net/wireless)"
elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ] ; then
[ "$(cat /sys/class/net/w*/flags 2>/dev/null)" = '0x1003' ] && wifiicon=" " || wifiicon="❌ "
[ "$(cat /sys/class/net/w*/flags 2>/dev/null)" = '0x1003' ] && wifiicon=" " || wifiicon="❌"
fi
# Ethernet
[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon=""
[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && wifiicon=""
printf "%s%s%s\n" "$wifiicon" "$ethericon"
printf "%s%s%s\n" "$wifiicon"

View File

@ -1,5 +1,5 @@
#!/bin/sh
while true; do
mpc idle player > /dev/null
pkill -RTMIN+8 dwmblocks
pkill -RTMIN+11 dwmblocks
done