feat: added display for wireguard and openvpn VPNs in polybar

Signed-off-by: Louis Vallat <louis@louis-vallat.xyz>
This commit is contained in:
Louis Vallat 2022-12-01 11:26:58 +01:00
parent 52a75000c2
commit 0d1a559f81
No known key found for this signature in database
GPG Key ID: 0C87282F76E61283

View File

@ -50,7 +50,7 @@ font-1 = IPAゴシック:style=Regular
modules-left = date bspwm
modules-center = xwindow
modules-right = pulseaudio memory cpu wlan eth_dock eth_internal battery
modules-right = wireguard openvpn pulseaudio memory cpu wlan eth_dock eth_internal battery
wm-restack = bspwm
@ -61,6 +61,26 @@ tray-position = right
tray-padding = 2
tray-detached = false
[module/openvpn]
type = custom/script
exec = nmcli connection show --active | grep 'vpn' | cut -f 1 -d' '
exec-if = pgrep -x openvpn
format-prefix = "嬨 "
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #e481ea
label = %output:0:15:...%
[module/wireguard]
type = custom/script
exec = sudo wg | grep interface | cut -f 2 -d' ' | tr '\n' ' '
exec-if = sudo wg | grep interface
format-prefix = " "
format-prefix-foreground = ${colors.foreground-alt}
format-underline = #bdd4e7
label = %output:0:15:...%
[module/xwindow]
type = internal/xwindow
label = %title:0:50:...%