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
This commit is contained in:
parent
3215e7b4bb
commit
97358cfe81
1 changed files with 3 additions and 1 deletions
|
@ -2,6 +2,7 @@
|
||||||
|
|
||||||
# Show wifi 📶 and percent strength or 📡 if none.
|
# Show wifi 📶 and percent strength or 📡 if none.
|
||||||
# Show 🌐 if connected to ethernet or ❎ if none.
|
# Show 🌐 if connected to ethernet or ❎ if none.
|
||||||
|
# Show 🔒 if a vpn connection is active
|
||||||
|
|
||||||
case $BLOCK_BUTTON in
|
case $BLOCK_BUTTON in
|
||||||
1) "$TERMINAL" -e nmtui; pkill -RTMIN+4 dwmblocks ;;
|
1) "$TERMINAL" -e nmtui; pkill -RTMIN+4 dwmblocks ;;
|
||||||
|
@ -10,6 +11,7 @@ case $BLOCK_BUTTON in
|
||||||
📶: wifi connection with quality
|
📶: wifi connection with quality
|
||||||
❎: no ethernet
|
❎: no ethernet
|
||||||
🌐: ethernet working
|
🌐: ethernet working
|
||||||
|
🔒: vpn is active
|
||||||
" ;;
|
" ;;
|
||||||
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
6) "$TERMINAL" -e "$EDITOR" "$0" ;;
|
||||||
esac
|
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)" ;;
|
up) wifiicon="$(awk '/^\s*w/ { print "📶", int($3 * 100 / 70) "% " }' /proc/net/wireless)" ;;
|
||||||
esac
|
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)"
|
||||||
|
|
Loading…
Reference in a new issue