Show wireguard status in menubar.
This commit is contained in:
parent
8ef644ccf9
commit
814cc42121
1 changed files with 4 additions and 4 deletions
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
case "$(cat /sys/class/net/w*/operstate 2>/dev/null)" in
|
ip a | grep -q wg0 && wg_status="wireguard running " || wg_status=""
|
||||||
down) printf "no wifi" ;;
|
case "$(cat /sys/class/net/wlan0/operstate 2>/dev/null)" in
|
||||||
|
down) printf "${wg_status} no wifi" ;;
|
||||||
up)
|
up)
|
||||||
[ -n "$(ip address show dev wlan0 | grep 'inet ')" ] || printf "no ip"
|
[ -n "$(ip address show dev wlan0 | grep 'inet ')" ] && printf "${wg_status}"|| printf "${wg_status}no ip" ;;
|
||||||
# && printf "$icon $(iwgetid -r)" \
|
|
||||||
esac
|
esac
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue