vpn eww and eww crash

This commit is contained in:
2026-09-10 21:02:27 +02:00
parent 7bb27f9373
commit a53f120b63
14 changed files with 246 additions and 51 deletions
@@ -83,6 +83,29 @@
:visible {!bt.powered}
:text "Disabled")))
; --- WireGuard ---
(defwidget wg-row [wg]
(box :orientation "v" :space-evenly false :class "wg-row"
(box :orientation "h" :space-evenly false :valign "center"
(label :class "wg-name ${wg.up ? 'wg-up' : 'wg-down'}" :halign "start" :hexpand true :text {wg.name})
(button
:class "net-toggle-btn ${wg.up ? 'net-toggle-on' : 'net-toggle-off'}"
:onclick "scripts/net/wg-toggle ${wg.name}"
:tooltip {wg.up ? "Disconnect" : "Connect"}
(label :text {wg.up ? "󰖂" : "󰦞"})))
(box :orientation "v" :space-evenly false :visible {wg.up}
(netinfo-row :label "IP" :value {wg.ip})
(netinfo-row :label "Peer" :value {wg.endpoint != "" ? "${wg.peers} · ${wg.endpoint}" : wg.peers})
(netinfo-row :label "Traffic" :value "󰇚 ${wg.rx} 󰕒 ${wg.tx}"))
(label :class "netinfo-dim" :halign "start" :visible {!wg.up} :text "Down")))
(defwidget wireguard-net-section []
(box :orientation "v" :space-evenly false :class "sys-section"
(section-header :title "WireGuard" :accent "wg-accent")
(for wg in {net.wireguard}
(wg-row :wg {wg}))))
; --- Root ---
(defwidget net-win []
@@ -94,4 +117,7 @@
(box :class "section-sep")
(wifi-net-section)
(box :class "section-sep")
(box :visible {arraylength(net.wireguard) > 0} :space-evenly false :orientation "v"
(wireguard-net-section)
(box :class "section-sep"))
(bluetooth-net-section)))