waybar: Improve vpn block icon rendering

This is a change which is very much hardcoded for my setup, but the vpn
block will now give preference to displaying individual VPN types from
top to bottom:

If privateinternetaccess is connected, it will display its icon.
If proton is connected, it will display its icon.
If netbird is connected it will display its icon.
If nothing is connected it will display nothing.

It is still quite a hacky solution and should also be replaced by a
signal-driven system instead of the recurrent polling it does currently
(it only polls once a minute atm, to keep system load/battery drain low
but since it invokes a lot of external commands, e.g. piactl and
netbird, it should really only be invoked on vpn changes).
This commit is contained in:
Marty Oehme 2024-07-26 10:56:36 +02:00
parent 12d186d871
commit 017668792c
Signed by: Marty
GPG key ID: EDBF2ED917B2EF6A
2 changed files with 26 additions and 9 deletions

View file

@ -145,7 +145,7 @@
"format": "{} ",
},
"river/window": {
"format": " {}",
"format": " {}",
"max-length": 70
},
"temperature": {
@ -166,8 +166,11 @@
"interval": 3600
},
"custom/wireguard": {
"format": "{icon}",
"format-icons": {
"default": "󰖂"
"default": "",
"pia": "󰖂",
"netbird": "󱗆"
},
"exec": "~/.config/waybar/modules/wireguard json",
"exec-if": "command -v nmcli >/dev/null 2>&1",