Compare commits

...

4 commits

Author SHA1 Message Date
Damocles
25c2ed1021 perf: gate sparkline repaints on panel visibility 2026-04-15 02:27:09 +02:00
Damocles
59547f81f1 fix: use is_multiple_of to satisfy clippy 2026-04-15 02:23:03 +02:00
Damocles
ffac11b186 ci: add clippy to nativeBuildInputs for clippy check 2026-04-15 02:21:04 +02:00
Damocles
7423990f34 ci: add clippy check to nix flake check 2026-04-15 02:20:12 +02:00
4 changed files with 21 additions and 3 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
result result
result-* result-*
stats-daemon/target/

View file

@ -92,6 +92,13 @@
formatting = treefmt-eval.config.build.check self; formatting = treefmt-eval.config.build.check self;
build = self.packages.${pkgs.stdenv.hostPlatform.system}.default; build = self.packages.${pkgs.stdenv.hostPlatform.system}.default;
nova-stats = self.packages.${pkgs.stdenv.hostPlatform.system}.nova-stats; nova-stats = self.packages.${pkgs.stdenv.hostPlatform.system}.nova-stats;
nova-stats-clippy = (pkgs.callPackage ./nix/stats-daemon.nix { }).overrideAttrs (old: {
pname = "nova-stats-clippy";
nativeBuildInputs = old.nativeBuildInputs ++ [ pkgs.clippy ];
buildPhase = "cargo clippy --all-targets -- -D warnings";
installPhase = "touch $out";
doCheck = false;
});
} }
); );

View file

@ -202,8 +202,18 @@ M.BarSection {
property var _hist: root._coreHistory[parent.parent.index] || [] property var _hist: root._coreHistory[parent.parent.index] || []
property color _col: parent.parent._barColor property color _col: parent.parent._barColor
on_HistChanged: requestPaint() on_HistChanged: if (root._showPanel)
on_ColChanged: requestPaint() requestPaint()
on_ColChanged: if (root._showPanel)
requestPaint()
Connections {
target: root
function on_ShowPanelChanged() {
if (root._showPanel)
sparkline.requestPaint();
}
}
onPaint: { onPaint: {
const ctx = getContext("2d"); const ctx = getContext("2d");

View file

@ -177,7 +177,7 @@ fn main() {
emit_cpu(&mut out, &prev, &curr, &freqs); emit_cpu(&mut out, &prev, &curr, &freqs);
prev = curr; prev = curr;
if tick % 2 == 0 { if tick.is_multiple_of(2) {
emit_mem(&mut out); emit_mem(&mut out);
} }