33 lines
1.6 KiB
Plaintext
33 lines
1.6 KiB
Plaintext
(deflisten gpu :initial '{"gfx_pct":0,"mem_pct":0,"media_pct":0,"sclk":0,"mclk":0,"sclk_pct":0,"mclk_pct":0,"vclk":0,"vclk_pct":0,"temp":0,"power":0,"vram_used":0,"vram_total":1}' "scripts/sys/gpu")
|
|
(deflisten memory :initial '{"total":1,"used":0,"cached":0,"human":{"total":"0G","used":"0G","cached":"0G"},"swap":{"total":0,"used":0,"human":{"total":"0G","used":"0G"}}}' "scripts/sys/memory")
|
|
|
|
; state: charging | discharging | low | full | idle | none — styled via .bat-<state>
|
|
(deflisten battery :initial '{"visible":false,"percentage":0,"wattage":"","status":"","state":"none"}' "scripts/sys/battery")
|
|
|
|
(defwidget sys-mod []
|
|
(module
|
|
(eventbox
|
|
:onclick "scripts/panel-toggle sys"
|
|
(box :orientation "v"
|
|
(circular-progress
|
|
:value {EWW_CPU.avg}
|
|
:class "cpubar"
|
|
:width 28 :height 28 :thickness 6
|
|
:tooltip "CPU ${round(EWW_CPU.avg, 0)}%")
|
|
(circular-progress
|
|
:value {gpu.gfx_pct}
|
|
:class "gpubar"
|
|
:width 28 :height 28 :thickness 6
|
|
:tooltip "GPU ${round(gpu.gfx_pct, 0)}%")
|
|
(circular-progress
|
|
:value {100*memory.used/memory.total}
|
|
:class "membar"
|
|
:width 28 :height 28 :thickness 6
|
|
:tooltip "RAM ${memory.human.used} / ${memory.human.total}")
|
|
(circular-progress
|
|
:value {battery.percentage}
|
|
:class "batbar bat-${battery.state}"
|
|
:visible {battery.visible}
|
|
:width 28 :height 28 :thickness 6
|
|
:tooltip "Bat ${round(battery.percentage, 0)}% · ${battery.status} @ ${battery.wattage}")))))
|