improve eww
This commit is contained in:
@@ -1,12 +1,4 @@
|
||||
|
||||
(deflisten netinfo
|
||||
:initial '{"wifi":{"ssid":"","ip":"","freq":0,"band":"","gen":"","signal":0},"ethernet":{"state":"down","ip":"","speed":"","interface":""},"usb":{"interface":"","ip":""}}'
|
||||
"scripts/net/netinfo")
|
||||
|
||||
(deflisten bt-devices
|
||||
:initial "[]"
|
||||
"scripts/net/bt-devices")
|
||||
|
||||
; --- Shared widgets ---
|
||||
|
||||
(defwidget netinfo-row [label value]
|
||||
@@ -34,10 +26,10 @@
|
||||
:icon-on "" :icon-off "")
|
||||
(box :orientation "v" :space-evenly false
|
||||
:visible {net.wifi.connected}
|
||||
(netinfo-row :label "SSID" :value {netinfo.wifi.ssid})
|
||||
(netinfo-row :label "IP" :value {netinfo.wifi.ip})
|
||||
(netinfo-row :label "Signal" :value "${net.wifi.icon} ${netinfo.wifi.signal} dBm")
|
||||
(netinfo-row :label "Freq" :value "${netinfo.wifi.freq} MHz · ${netinfo.wifi.band} · ${netinfo.wifi.gen}"))
|
||||
(netinfo-row :label "SSID" :value {net.wifi.ssid})
|
||||
(netinfo-row :label "IP" :value {net.wifi.ip})
|
||||
(netinfo-row :label "Signal" :value "${net.wifi.icon} ${net.wifi.signal} dBm")
|
||||
(netinfo-row :label "Freq" :value "${net.wifi.freq} MHz · ${net.wifi.band} · ${net.wifi.gen}"))
|
||||
(label :class "netinfo-dim" :halign "start"
|
||||
:visible {!net.wifi.connected}
|
||||
:text {net.wifi.enabled ? "Not connected" : "Disabled"})))
|
||||
@@ -47,8 +39,8 @@
|
||||
(defwidget usb-net-section []
|
||||
(box :orientation "v" :space-evenly false :class "sys-section"
|
||||
(section-header :title "USB" :accent "usb-accent")
|
||||
(netinfo-row :label "Interface" :value {netinfo.usb.interface})
|
||||
(netinfo-row :label "IP" :value {netinfo.usb.ip})))
|
||||
(netinfo-row :label "Interface" :value {net.usb.interface})
|
||||
(netinfo-row :label "IP" :value {net.usb.ip})))
|
||||
|
||||
; --- Ethernet ---
|
||||
|
||||
@@ -57,9 +49,9 @@
|
||||
(section-header :title "Ethernet" :accent "eth-accent")
|
||||
(box :orientation "v" :space-evenly false
|
||||
:visible {net.ethernet.connected}
|
||||
(netinfo-row :label "Interface" :value {netinfo.ethernet.interface})
|
||||
(netinfo-row :label "IP" :value {netinfo.ethernet.ip})
|
||||
(netinfo-row :label "Speed" :value {netinfo.ethernet.speed}))
|
||||
(netinfo-row :label "Interface" :value {net.ethernet.interface})
|
||||
(netinfo-row :label "IP" :value {net.ethernet.ip})
|
||||
(netinfo-row :label "Speed" :value {net.ethernet.speed}))
|
||||
(label :class "netinfo-dim" :halign "start"
|
||||
:visible {!net.ethernet.connected}
|
||||
:text "No carrier")))
|
||||
@@ -79,16 +71,16 @@
|
||||
(box :orientation "v" :space-evenly false :class "sys-section"
|
||||
(section-header-toggle
|
||||
:title "Bluetooth" :accent "blt-accent"
|
||||
:enabled {bluetooth.powered}
|
||||
:onclick {bluetooth.powered ? "bluetoothctl power off" : "bluetoothctl power on"}
|
||||
:enabled {bt.powered}
|
||||
:onclick {bt.powered ? "bluetoothctl power off" : "bluetoothctl power on"}
|
||||
:icon-on "" :icon-off "")
|
||||
(scroll :vscroll true :hscroll false :height 90
|
||||
:visible {bluetooth.powered}
|
||||
:visible {bt.powered}
|
||||
(box :orientation "v" :space-evenly false
|
||||
(for device in {bt-devices}
|
||||
(for device in {bt.devices}
|
||||
(bt-device-row :device {device}))))
|
||||
(label :class "netinfo-dim" :halign "start"
|
||||
:visible {!bluetooth.powered}
|
||||
:visible {!bt.powered}
|
||||
:text "Disabled")))
|
||||
|
||||
; --- Root ---
|
||||
|
||||
Reference in New Issue
Block a user