Eww update
This commit is contained in:
@@ -1,130 +1,212 @@
|
||||
|
||||
(defpoll swap :interval "5s" "scripts/sys/swap")
|
||||
|
||||
(defpoll cpu-freq-min :interval "60s"
|
||||
"awk '{print $1/1000}' /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_min_freq")
|
||||
(defpoll cpu-freq-max :interval "60s"
|
||||
"awk '{print $1/1000}' /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq")
|
||||
(defpoll cpu-temp :interval "2s"
|
||||
"scripts/sys/cputemp")
|
||||
(defpoll cpu-freq-avg :interval "2s"
|
||||
"awk '{sum+=$1; count++} END {printf \"%.1f\", sum/count/1000000}' /sys/devices/system/cpu/cpu*/cpufreq/scaling_cur_freq")
|
||||
|
||||
(deflisten cpu-grid :initial '[[{"core":0,"usage":0,"freq":0}]]'
|
||||
"bash scripts/sys/cpugrid")
|
||||
|
||||
; --- Shared ---
|
||||
|
||||
(defwidget section-header [title accent]
|
||||
(box :orientation "h" :space-evenly false :valign "center" :class "sys-section-header"
|
||||
(box :class "section-accent ${accent}")
|
||||
(label :class "sys-label" :text title)))
|
||||
|
||||
; --- CPU ---
|
||||
|
||||
(defwidget cpu-core-cell [core]
|
||||
(overlay
|
||||
(circular-progress
|
||||
:width 60 :height 60
|
||||
:value {core.usage}
|
||||
:start-at 0
|
||||
:clockwise true
|
||||
:thickness 7
|
||||
:class "cpu-usage-ring")
|
||||
(circular-progress
|
||||
:value {100 * (core.freq - cpu-freq-min) / (cpu-freq-max - cpu-freq-min)}
|
||||
:start-at 0
|
||||
:clockwise true
|
||||
:thickness 4
|
||||
:class "cpu-freq-ring")
|
||||
(box :halign "center" :valign "center"
|
||||
(label :class "cpu-core-label" :text "${core.core}"))
|
||||
)
|
||||
)
|
||||
|
||||
(defwidget cpu-sys-win []
|
||||
(box
|
||||
:orientation "v"
|
||||
:space-evenly false
|
||||
(box :class "sys-label" "CPU")
|
||||
(box
|
||||
:orientation "v"
|
||||
(for core in {EWW_CPU.cores}
|
||||
(box
|
||||
:space-evenly false
|
||||
:class "cpu-core ${core.core}"
|
||||
(progress
|
||||
:value {core.usage}
|
||||
:orientation "h"
|
||||
:flipped true
|
||||
:class "cpu-core-usage"
|
||||
:tooltip "${core.core} @ ${core.freq}Mhz"
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
(box :orientation "v" :space-evenly false :class "sys-section"
|
||||
(section-header :title "CPU" :accent "cpu-accent")
|
||||
(box :orientation "v" :space-evenly false :halign "center"
|
||||
(for row in {cpu-grid}
|
||||
(box :orientation "h" :space-evenly false
|
||||
(for core in {row}
|
||||
(cpu-core-cell :core {core})))))
|
||||
(box :orientation "h" :space-evenly true :class "gpu-stats-row"
|
||||
(box :orientation "v" :halign "center" :space-evenly false
|
||||
(label :class "gpu-stat-value" :text "${cpu-temp}°C")
|
||||
(label :class "gpu-stat-label" :text "temp"))
|
||||
(box :orientation "v" :halign "center" :space-evenly false
|
||||
(label :class "gpu-stat-value" :text "${cpu-freq-avg}GHz")
|
||||
(label :class "gpu-stat-label" :text "avg clk"))
|
||||
(box :orientation "v" :halign "center" :space-evenly false
|
||||
(label :class "gpu-stat-value" :text "${round(EWW_CPU.avg, 0)}%")
|
||||
(label :class "gpu-stat-label" :text "usage")))
|
||||
)
|
||||
)
|
||||
|
||||
; --- GPU ---
|
||||
|
||||
(defwidget gpu-sys-win []
|
||||
(box
|
||||
:orientation "v"
|
||||
:space-evenly false
|
||||
(box :class "sys-label" "GPU")
|
||||
(progress
|
||||
:value {gpu.devices[0].GRBM2?.CommandProcessor-Compute?.value?:0.0}
|
||||
:orientation "h"
|
||||
:flipped true
|
||||
:class "gpu-core-usage"
|
||||
:tooltip "Compute"
|
||||
)
|
||||
(progress
|
||||
:value {gpu.devices[0].GRBM2?.CommandProcessor-Fetcher?.value?:0.0}
|
||||
:orientation "h"
|
||||
:flipped true
|
||||
:class "gpu-core-usage"
|
||||
:tooltip "Fetcher"
|
||||
)
|
||||
(progress
|
||||
:value {gpu.devices[0].GRBM2?.CommandProcessor-Graphics?.value?:0.0}
|
||||
:orientation "h"
|
||||
:flipped true
|
||||
:class "gpu-core-usage"
|
||||
:tooltip "Graphics"
|
||||
)
|
||||
(box :class "spacer")
|
||||
(progress
|
||||
:value {gpu.devices[0]?.gpu_activity?.GFX?.value?:0.0}
|
||||
:orientation "h"
|
||||
:flipped true
|
||||
:class "gpu-core-usage"
|
||||
:tooltip "GFX"
|
||||
)
|
||||
(progress
|
||||
:value {gpu.devices[0]?.gpu_activity?.Memory?.value?:0.0}
|
||||
:orientation "h"
|
||||
:flipped true
|
||||
:class "gpu-core-usage"
|
||||
:tooltip "Memory"
|
||||
)
|
||||
(progress
|
||||
:value {gpu.devices[0]?.gpu_activity?.MediaEngine?.value?:0.0}
|
||||
:orientation "h"
|
||||
:flipped true
|
||||
:class "gpu-core-usage"
|
||||
:tooltip "Media"
|
||||
)
|
||||
(box :class "spacer")
|
||||
(progress
|
||||
:value {100*(gpu.devices[0]?.VRAM?.TotalVRAMUsage?.value?:0.0)/(gpu.devices[0]?.VRAM?.TotalVRAM?.value?:1.0)}
|
||||
:orientation "h"
|
||||
:flipped true
|
||||
:class "gpu-core-usage"
|
||||
:tooltip "VRAM"
|
||||
(box :orientation "v" :space-evenly false :class "sys-section"
|
||||
(section-header :title "GPU" :accent "gpu-accent")
|
||||
(box :orientation "h" :space-evenly true
|
||||
; GFX — outer: activity%, inner: clock% of range
|
||||
(box :orientation "v" :space-evenly false :halign "center"
|
||||
(overlay
|
||||
(circular-progress :width 68 :height 68
|
||||
:value {gpu.gfx_pct}
|
||||
:start-at 0 :clockwise true :thickness 7
|
||||
:class "gpu-ring"
|
||||
:tooltip "GFX ${round(gpu.gfx_pct, 1)}%\nClock ${gpu.sclk} MHz (${round(gpu.sclk_pct, 0)}% of range)")
|
||||
(circular-progress
|
||||
:value {gpu.sclk_pct}
|
||||
:start-at 0 :clockwise true :thickness 4
|
||||
:class "gpu-freq-ring")
|
||||
(box :halign "center" :valign "center"
|
||||
(label :class "gpu-ring-value" :text "${round(gpu.gfx_pct, 0)}%")))
|
||||
(label :class "gpu-ring-label" :text "GFX" :halign "center"))
|
||||
; Memory — outer: activity%, inner: memory clock% of range
|
||||
(box :orientation "v" :space-evenly false :halign "center"
|
||||
(overlay
|
||||
(circular-progress :width 68 :height 68
|
||||
:value {gpu.mem_pct}
|
||||
:start-at 0 :clockwise true :thickness 7
|
||||
:class "gpu-ring"
|
||||
:tooltip "Memory ${round(gpu.mem_pct, 1)}%\nClock ${gpu.mclk} MHz (${round(gpu.mclk_pct, 0)}% of range)")
|
||||
(circular-progress
|
||||
:value {gpu.mclk_pct}
|
||||
:start-at 0 :clockwise true :thickness 4
|
||||
:class "gpu-freq-ring")
|
||||
(box :halign "center" :valign "center"
|
||||
(label :class "gpu-ring-value" :text "${round(gpu.mem_pct, 0)}%")))
|
||||
(label :class "gpu-ring-label" :text "Mem" :halign "center"))
|
||||
; Media — outer: activity%, inner: video clock% of GPU clock max
|
||||
(box :orientation "v" :space-evenly false :halign "center"
|
||||
(overlay
|
||||
(circular-progress :width 68 :height 68
|
||||
:value {gpu.media_pct}
|
||||
:start-at 0 :clockwise true :thickness 7
|
||||
:class "gpu-ring"
|
||||
:tooltip "Media Engine ${round(gpu.media_pct, 1)}%\nVideo Clock ${gpu.vclk} MHz")
|
||||
(circular-progress
|
||||
:value {gpu.vclk_pct}
|
||||
:start-at 0 :clockwise true :thickness 4
|
||||
:class "gpu-freq-ring")
|
||||
(box :halign "center" :valign "center"
|
||||
(label :class "gpu-ring-value" :text "${round(gpu.media_pct, 0)}%")))
|
||||
(label :class "gpu-ring-label" :text "Med" :halign "center")))
|
||||
(box :orientation "v" :space-evenly false :class "vram-row"
|
||||
(progress
|
||||
:value {100 * gpu.vram_used / gpu.vram_total}
|
||||
:orientation "h" :flipped true :hexpand true
|
||||
:class "vram-bar"
|
||||
:tooltip "VRAM ${round(100 * gpu.vram_used / gpu.vram_total, 1)}%")
|
||||
(box :orientation "h" :space-evenly false
|
||||
(label :class "vram-usage-label" :halign "start" :hexpand true :text "VRAM")
|
||||
(label :class "vram-usage-label" :halign "end"
|
||||
:text "${round(gpu.vram_used / 1024, 1)} / ${round(gpu.vram_total / 1024, 1)} GiB")))
|
||||
(box :orientation "h" :space-evenly true :class "gpu-stats-row"
|
||||
(box :orientation "v" :halign "center" :space-evenly false
|
||||
(label :class "gpu-stat-value" :text "${gpu.temp}°C")
|
||||
(label :class "gpu-stat-label" :text "temp"))
|
||||
(box :orientation "v" :halign "center" :space-evenly false
|
||||
(label :class "gpu-stat-value" :text "${gpu.power}W")
|
||||
(label :class "gpu-stat-label" :text "power")))
|
||||
)
|
||||
)
|
||||
|
||||
; --- RAM ---
|
||||
|
||||
(defwidget ram-sys-win []
|
||||
(box :orientation "v" :space-evenly false :class "sys-section"
|
||||
(section-header :title "RAM" :accent "ram-accent")
|
||||
(box :orientation "h" :space-evenly false :halign "center" :spacing 16 :valign "center"
|
||||
(overlay
|
||||
(circular-progress
|
||||
:width 88 :height 88
|
||||
:value {100*memory.used/memory.total}
|
||||
:start-at 0
|
||||
:clockwise true
|
||||
:thickness 9
|
||||
:class "ram-ring"
|
||||
:tooltip "RAM\nUsed ${memory.human.used} / ${memory.human.total}\nCached ${memory.human.cached}")
|
||||
(circular-progress
|
||||
:value {100*memory.cached/memory.total}
|
||||
:start-at {100*memory.used/memory.total}
|
||||
:clockwise true
|
||||
:thickness 9
|
||||
:class "ram-cached-ring")
|
||||
(box :orientation "v" :valign "center" :halign "center" :space-evenly false
|
||||
(label :class "ram-used-label" :text "${memory.human.used}")
|
||||
(label :class "ram-total-label" :text "${memory.human.total}")))
|
||||
(box :orientation "v" :space-evenly false :halign "center" :valign "center"
|
||||
(overlay
|
||||
(circular-progress
|
||||
:width 60 :height 60
|
||||
:value {100*swap.used/swap.total}
|
||||
:start-at 0 :clockwise true :thickness 7
|
||||
:class "swap-ring"
|
||||
:tooltip "Swap\n${swap.human.used} / ${swap.human.total}")
|
||||
(box :orientation "v" :valign "center" :halign "center" :space-evenly false
|
||||
(label :class "ram-used-label" :text "${swap.human.used}")
|
||||
(label :class "ram-total-label" :text "${swap.human.total}"))))
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
(defwidget ram-sys-win []
|
||||
(box
|
||||
:orientation "v"
|
||||
:space-evenly false
|
||||
(box :class "sys-label" "RAM")
|
||||
(progress
|
||||
:value {100*memory.used/memory.total}
|
||||
:orientation "h"
|
||||
:flipped true
|
||||
:class "memory-usage"
|
||||
:tooltip "RAM"
|
||||
)
|
||||
; --- Battery ---
|
||||
|
||||
(defwidget bat-sys-win []
|
||||
(box :orientation "v" :space-evenly false :class "sys-section" :visible {battery.visible}
|
||||
(section-header :title "Battery" :accent "bat-accent")
|
||||
(overlay
|
||||
(circular-progress
|
||||
:width 60 :height 60
|
||||
:value {battery.percentage}
|
||||
:start-at 0
|
||||
:clockwise true
|
||||
:thickness 6
|
||||
:class "bat-ring"
|
||||
:style "color: ${battery.color};"
|
||||
:tooltip "Battery ${round(battery.percentage, 0)}%\n${battery.status} @ ${battery.wattage}")
|
||||
(label :class "bat-ring-label"
|
||||
:text "${round(battery.percentage, 0)}%"))
|
||||
)
|
||||
)
|
||||
|
||||
; --- Root ---
|
||||
|
||||
(defwidget sys-win []
|
||||
(box
|
||||
:class "sys-win"
|
||||
:space-evenly false
|
||||
:orientation "h"
|
||||
(box
|
||||
:space-evenly false
|
||||
:orientation "v"
|
||||
(cpu-sys-win)
|
||||
(box :class "spacer")
|
||||
(box :class "spacer")
|
||||
(gpu-sys-win)
|
||||
(box :class "spacer")
|
||||
(box :class "spacer")
|
||||
(ram-sys-win)
|
||||
)
|
||||
(box
|
||||
:visible {battery.visible}
|
||||
:height 200
|
||||
(graph
|
||||
:height 200
|
||||
:value {battery.percentage}
|
||||
:time-range "30min"
|
||||
:min "0.0"
|
||||
:max "100.0"
|
||||
:dynamic true
|
||||
)
|
||||
)
|
||||
:orientation "v"
|
||||
(cpu-sys-win)
|
||||
(box :class "section-sep")
|
||||
(gpu-sys-win)
|
||||
(box :class "section-sep")
|
||||
(ram-sys-win)
|
||||
(box :class "section-sep" :visible {battery.visible})
|
||||
(bat-sys-win)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -134,7 +216,7 @@
|
||||
:geometry (geometry
|
||||
:x "0%"
|
||||
:y "0%"
|
||||
:anchor "bottom right"
|
||||
:width "0px"
|
||||
:anchor "bottom right"
|
||||
:width "320px"
|
||||
:height "0px")
|
||||
(window (sys-win)))
|
||||
|
||||
Reference in New Issue
Block a user