1
0
Fork 0

sb-network: add tun devices

This commit is contained in:
Luca Bilke 2024-08-06 13:58:47 +02:00
parent a96426ff8a
commit da9e1b0647

View file

@ -32,6 +32,11 @@ wireguard() {
shift=" " shift=" "
} }
tun() {
printf "%b" "$shift󰖂 $connection"
shift=" "
}
ethernet() { ethernet() {
case "$state" in case "$state" in
connected) icon="󰱓" ;; connected) icon="󰱓" ;;
@ -48,6 +53,8 @@ fallback() {
: :
} }
IFS="
"
for x in $(nmcli --terse device status); do for x in $(nmcli --terse device status); do
device="$(echo "$x" | cut -d: -f1)" device="$(echo "$x" | cut -d: -f1)"
type="$(echo "$x" | cut -d: -f2)" type="$(echo "$x" | cut -d: -f2)"
@ -56,7 +63,7 @@ for x in $(nmcli --terse device status); do
info="/sys/class/net/${device}" info="/sys/class/net/${device}"
case "$type" in case "$type" in
wifi | wireguard | ethernet) $type ;; wifi | wireguard | ethernet | tun) $type ;;
*) fallback ;; *) fallback ;;
esac esac
unset device type state connection info icon unset device type state connection info icon