From 1ddcf99fc642e6cf2482129058811cf327291797 Mon Sep 17 00:00:00 2001 From: Brandon <151687291+btkoch@users.noreply.github.com> Date: Sun, 14 Jan 2024 17:00:12 -0500 Subject: [PATCH 1/2] Update sb-internet Fix ethernet icon for systems with multiple NICs wherein `cat /sys/class/net/e*/operstate ` outputs multiple lines. Icon now shows connected when one or more NICs are connected. --- .local/bin/statusbar/sb-internet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet index 6d0c51334b..705911c30f 100755 --- a/.local/bin/statusbar/sb-internet +++ b/.local/bin/statusbar/sb-internet @@ -25,7 +25,7 @@ elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ] ; then fi # Ethernet -[ "$(cat /sys/class/net/e*/operstate 2>/dev/null)" = 'up' ] && ethericon="🌐" || ethericon="❎" +[ "$(cat /sys/class/net/e*/operstate 2>/dev/null | grep "up")" = 'up' ] && ethericon="🌐" || ethericon="❎" # TUN [ -n "$(cat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon=" 🔒" From d822a921d5ff8fb9d34b426af9968a43bbf3f137 Mon Sep 17 00:00:00 2001 From: Brandon <151687291+btkoch@users.noreply.github.com> Date: Wed, 31 Jan 2024 13:42:44 -0500 Subject: [PATCH 2/2] Fix disconnected status when both NICs active --- .local/bin/statusbar/sb-internet | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.local/bin/statusbar/sb-internet b/.local/bin/statusbar/sb-internet index 705911c30f..b22ae4fbbc 100755 --- a/.local/bin/statusbar/sb-internet +++ b/.local/bin/statusbar/sb-internet @@ -25,7 +25,7 @@ elif [ "$(cat /sys/class/net/w*/operstate 2>/dev/null)" = 'down' ] ; then fi # Ethernet -[ "$(cat /sys/class/net/e*/operstate 2>/dev/null | grep "up")" = 'up' ] && ethericon="🌐" || ethericon="❎" +cat /sys/class/net/e*/operstate 2>/dev/null | grep -q "up" && ethericon="🌐" || ethericon="❎" # TUN [ -n "$(cat /sys/class/net/tun*/operstate 2>/dev/null)" ] && tunicon=" 🔒"