From f1951f2ee1e83d802030c257d4a1df099ec08976 Mon Sep 17 00:00:00 2001 From: Paul Buetow Date: Wed, 18 Feb 2026 09:33:08 +0200 Subject: feat: add fixed load scale (--loadmax), load peak reset (r key), update README - config: add LoadMax float64 field; loadmax key in ~/.loadbarsrc; written by 'w' - main: add --loadmax flag (overrides rc file when > 0) - display: newRunState initialises loadPeak from LoadMax when fixed - display: updateLoadPeak accepts loadMax param; short-circuits to fixed value when set - display: add 'r' hotkey to reset auto-scale peak to floor (2.0); no-op when fixed - tooltip: loadTooltipLines shows 'Max:' label when scale is fixed, 'Peak:' for auto - README: document 4/l load toggle, r reset, --showload, --loadmax, load average bars section; fix --cpumode entry Co-Authored-By: Claude Sonnet 4.6 --- cmd/loadbars/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'cmd') diff --git a/cmd/loadbars/main.go b/cmd/loadbars/main.go index 0ee8071..dd86723 100644 --- a/cmd/loadbars/main.go +++ b/cmd/loadbars/main.go @@ -35,6 +35,7 @@ func main() { flag.StringVar(&cfg.SSHOpts, "sshopts", cfg.SSHOpts, "Set SSH options") flag.BoolVar(&cfg.HasAgent, "hasagent", cfg.HasAgent, "SSH key already known by agent") flag.IntVar(&cfg.MaxBarsPerRow, "maxbarsperrow", cfg.MaxBarsPerRow, "Max bars per row (0=unlimited)") + loadmax := flag.Float64("loadmax", 0, "Fixed load bar full-height reference value (0 = auto-scale)") flag.Parse() @@ -48,7 +49,11 @@ func main() { os.Exit(constants.EUnknown) } - // Flags override config file; re-parse into cfg for hosts/cluster + // Flags override config file; re-parse into cfg for hosts/cluster. + // --loadmax overrides the rc file value when explicitly set to a positive number. + if *loadmax > 0 { + cfg.LoadMax = *loadmax + } if *cluster != "" { cfg.Cluster = *cluster } -- cgit v1.2.3