From da9e1b06475217883a8a84fbb88505011b44344c Mon Sep 17 00:00:00 2001 From: Luca Bilke <luca@bil.ke> Date: Tue, 6 Aug 2024 13:58:47 +0200 Subject: [PATCH] sb-network: add tun devices --- .local/libexec/statusbar/sb-internet | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/.local/libexec/statusbar/sb-internet b/.local/libexec/statusbar/sb-internet index 5c95287a..09da6ef3 100755 --- a/.local/libexec/statusbar/sb-internet +++ b/.local/libexec/statusbar/sb-internet @@ -32,6 +32,11 @@ wireguard() { shift=" " } +tun() { + printf "%b" "$shift $connection" + shift=" " +} + ethernet() { case "$state" in connected) icon="" ;; @@ -48,6 +53,8 @@ fallback() { : } +IFS=" +" for x in $(nmcli --terse device status); do device="$(echo "$x" | cut -d: -f1)" type="$(echo "$x" | cut -d: -f2)" @@ -56,7 +63,7 @@ for x in $(nmcli --terse device status); do info="/sys/class/net/${device}" case "$type" in - wifi | wireguard | ethernet) $type ;; + wifi | wireguard | ethernet | tun) $type ;; *) fallback ;; esac unset device type state connection info icon