(defvar reveal_network false)
(defwidget network []
  (revealer-on-hover
    :revealvar reveal_network
    :revealvar-name "reveal_network"
    (button :onclick 'nm-connection-editor'
            :class {network_status.wifi || network_status.wired ? "active" : ""}
      "")
    (network_children)))

(defwidget network_children []
  (box :class "reveal_children"
    :orientation "h"
    :space-evenly false
    :halign "center"
    (button :onclick {network_status.wifi ? 'scripts/bar/network-updown wifi down' : 'scripts/bar/network-updown wifi up'}
            :class {network_status.wifi ? "active" : ""}
      "")
    (button :onclick {network_status.wired ? 'scripts/bar/network-updown ethernet down' : 'scripts/bar/network-updown ethernet up'}
            :class {network_status.wired ? "active" : ""}
      "🖧")))
