Files
nixconfig/modules/home/wayland/apps/eww/bar/modules/net.yuck
2026-06-13 11:22:51 +02:00

31 lines
1.3 KiB
Plaintext

(deflisten net
:initial '{"wifi":{"connected":false,"enabled":false,"icon":"󰤮","ssid":""},"ethernet":{"connected":false},"usb":{"connected":false}}'
"scripts/net/net")
(deflisten bluetooth
:initial '{"powered":false,"connected":false,"device":""}'
"scripts/net/bluetooth")
(defwidget net-mod []
(module
(eventbox
:onclick "(sleep 0.1 && scripts/panel-toggle net)"
(box :orientation "v"
(label
:class "net-icon ${net.ethernet.connected ? 'net-active' : 'net-dim'}"
:tooltip {net.ethernet.connected ? "Ethernet: Connected" : "Ethernet: Disconnected"}
:text "󰈀")
(label
:visible {net.usb.connected}
:class "net-icon net-active"
:tooltip "USB: Connected"
:text "󰌷")
(label
:class "net-icon ${net.wifi.connected ? 'net-active' : 'net-dim'}"
:tooltip {net.wifi.connected ? "WiFi: ${net.wifi.ssid}" : "WiFi: Disconnected"}
:text {net.wifi.icon})
(label
:class "net-icon ${bluetooth.connected ? 'blt-connected' : bluetooth.powered ? 'blt-on' : 'net-dim'}"
:tooltip {bluetooth.connected ? "Bluetooth: ${bluetooth.device}" : bluetooth.powered ? "Bluetooth: On" : "Bluetooth: Off"}
:text {bluetooth.connected ? "󰂱" : bluetooth.powered ? "󰂯" : "󰂲"})))))