From 97358cfe8180b1abfe0d1fe06799277c06fa8f8a Mon Sep 17 00:00:00 2001 From: Astronach <16743141+Astronach@users.noreply.github.com> Date: Sat, 14 Nov 2020 21:11:08 +0100 Subject: [PATCH] add vpn indicator to internet status modul (#796) for me /sys/class/net/tun*/operstate show unknown in every state, but ./net/tun* only exists, if vpn is on --- .local/bin/statusbar/internet | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.local/bin/statusbar/internet b/.local/bin/statusbar/internet index d8bd896..ee1a160 100755 --- a/.local/bin/statusbar/internet +++ b/.local/bin/statusbar/internet @@ -2,6 +2,7 @@ # Show wifi 📶 and percent strength or 📡 if none. # Show 🌐 if connected to ethernet or ❎ if none. +# Show 🔒 if a vpn connection is active case $BLOCK_BUTTON in 1) "$TERMINAL" -e nmtui; pkill -RTMIN+4 dwmblocks ;; @@ -10,6 +11,7 @@ case $BLOCK_BUTTON in 📶: wifi connection with quality ❎: no ethernet 🌐: ethernet working +🔒: vpn is active " ;; 6) "$TERMINAL" -e "$EDITOR" "$0" ;; esac @@ -19,4 +21,4 @@ case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in 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 2>/dev/null)" +printf "%s%s%s\n" "$wifiicon" "$(sed "s/down/❎/;s/up/🌐/" /sys/class/net/e*/operstate 2>/dev/null)" "$(sed "s/.*/🔒/" /sys/class/net/tun*/operstate 2>/dev/null)"