1
0
mirror of https://github.com/tiyn/dotfiles.git synced 2025-03-27 21:47:46 +01:00

statusbar: added special case for inet

This commit is contained in:
tiyn 2023-10-17 19:23:26 +02:00
parent 3c19fddd90
commit 6670354d1a

View File

@ -1,8 +1,8 @@
#!/usr/bin/env sh
wifipercent=" ___"
wifipercent=" "
[ "$(cat /sys/class/net/w*/operstate)" = 'down' ] && wifiicon="^c#ff0000^ ^d^"
([ "$(cat /sys/class/net/w*/operstate)" = 'down' ] || ! [[ "/sys/class/net/w*/operstate" ]]) && wifiicon="^c#ff0000^ ^d^" && wifipercent=0
[ ! -n "${wifiicon+var}" ] && wifiicon="^c#dfdfdf^ ^d^" && wifipercent=$(grep "^\s*w" /proc/net/wireless | awk '{ print int($3 * 100 / 70) }')