diff options
| author | Paul Buetow <paul@buetow.org> | 2026-02-18 09:33:08 +0200 |
|---|---|---|
| committer | Paul Buetow <paul@buetow.org> | 2026-02-18 09:33:08 +0200 |
| commit | f1951f2ee1e83d802030c257d4a1df099ec08976 (patch) | |
| tree | bce1d38cc5b78e4cb5d80d6e0d316267bb15cb9f /cmd | |
| parent | d845cf3208c3bbdb7e3dd3041d1ae491b88d4d21 (diff) | |
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 <noreply@anthropic.com>
Diffstat (limited to 'cmd')
| -rw-r--r-- | cmd/loadbars/main.go | 7 |
1 files changed, 6 insertions, 1 deletions
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 } |
