Reworked Stats.qml and SysInfo to support nvidia, new theme yay!

This commit is contained in:
SomeElse
2026-05-29 07:10:03 +00:00
parent a380963757
commit 7d33521191
24 changed files with 461 additions and 46 deletions

View File

@@ -265,7 +265,7 @@ ModuleChip {
Rectangle {
anchors.centerIn: parent; width: 22; height: 22; radius: 11
color: isToday ? root.t.accent : "transparent"
color: isToday ? root.t.calTodayBg : "transparent"
border.color: isToday ? root.t.borderToday : "transparent"
border.width: isToday ? 2 : 0
visible: inMonth

View File

@@ -42,19 +42,27 @@ ModuleChip {
Process {
id: statsProc
command: ["sh", "-c",
"top -bn1 | awk '/^%Cpu/ {print 100-$8}'; " +
"free | awk '/Mem:/ {print ($2-$7)/$2 * 100}'; " +
"df / --output=pcent | tail -1 | awk '{print $1}'; " +
"(head -n 1 /proc/stat; sleep 1; head -n 1 /proc/stat) | awk " +
"'{u=$2+$3;s=$4;i=$5+$6;x=$7+$8;t=u+s+i+x;if(NR==1){p=t;q=i;next}" +
"{dt=t-p;di=i-q;print (dt>0?100*(dt-di)/dt:0)}}'; " +
"awk '/MemTotal/{t=$2}/MemAvailable/{a=$2}END" +
"{print (t>0?(t-a)/t*100:0)}' /proc/meminfo; " +
"df / | awk 'NR==2{sub(/%/,\"\",$5); print $5}'; " +
"ct=-1; for d in /sys/class/hwmon/hwmon*; do " +
"n=$(cat $d/name 2>/dev/null); " +
"if echo \"$n\" | grep -qiE 'coretemp|k10temp|cpu_thermal'; then " +
"if echo \"$n\" | grep -qiE " +
"'coretemp|k10temp|cpu_thermal|zenpower|acpitz|x86_pkg_temp|thinkpad|nct6775'; then " +
"ct=$(( $(cat $d/temp1_input 2>/dev/null) / 1000 )); break; " +
"fi; done; echo $ct; " +
"gt=-1; for d in /sys/class/hwmon/hwmon*; do " +
"n=$(cat $d/name 2>/dev/null); " +
"if echo \"$n\" | grep -qiE 'amdgpu|radeon'; then " +
"if echo \"$n\" | grep -qiE 'amdgpu|radeon|nouveau'; then " +
"gt=$(( $(cat $d/temp1_input 2>/dev/null) / 1000 )); break; " +
"fi; done; echo $gt"]
"fi; done; " +
"[ \"$gt\" = \"-1\" ] && " +
"gt=$(nvidia-smi --query-gpu=temperature.gpu " +
"--format=csv,noheader 2>/dev/null | head -n 1); " +
"echo $gt"]
property string rawOutput: ""
stdout: SplitParser {
onRead: data => { statsProc.rawOutput += data + "\n" }