dotfiles

My dotfiles used for LARBS
Log | Files | Refs | Submodules | README | LICENSE

commit 14fde603b7d85897b0322c3674bf494ae0346573
parent f08f4b0b7f8bf4c569f679f301313d563406b851
Author: Luke Smith <luke@lukesmith.xyz>
Date:   Wed,  6 May 2020 19:54:42 -0400

fix for no wifi, use case statement

Diffstat:
M.local/bin/statusbar/internet | 8+++++---
1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/.local/bin/statusbar/internet b/.local/bin/statusbar/internet @@ -13,7 +13,9 @@ case $BLOCK_BUTTON in " ;; esac -grep -q "down" /sys/class/net/w*/operstate && wifiicon="📡" || - wifiicon="$(grep "^\s*w" /proc/net/wireless | awk '{ print "📶", int($3 * 100 / 70) "%" }')" +case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in + down) wifiicon="📡 " ;; + up) wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)" ;; +esac -printf "%s %s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate)" +printf "%s%s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate 2>/dev/null)"