summaryrefslogtreecommitdiff
path: root/internal/config/config.go
diff options
context:
space:
mode:
authorPaul Buetow <paul@buetow.org>2026-02-16 22:53:17 +0200
committerPaul Buetow <paul@buetow.org>2026-02-16 22:53:17 +0200
commit6798b669464d828c241554647b4fff68a62ca91d (patch)
tree706fc2da37b27b89649afe650ec699170191ecb1 /internal/config/config.go
parent971928faff0c100ef591c2d0e92e94b9f46ae71a (diff)
Add global I/O avg line (hotkey i) and m/n hotkey aliases
Add a pink 1px line drawn from the top showing mean iowait+IRQ+softIRQ across all hosts, toggled with hotkey i and persistable to ~/.loadbarsrc. Also add m as alias for 2 (memory toggle) and n as alias for 3 (network toggle) for easier single-hand operation. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Diffstat (limited to 'internal/config/config.go')
-rw-r--r--internal/config/config.go10
1 files changed, 7 insertions, 3 deletions
diff --git a/internal/config/config.go b/internal/config/config.go
index 036d081..d53fd7f 100644
--- a/internal/config/config.go
+++ b/internal/config/config.go
@@ -24,8 +24,9 @@ type Config struct {
MaxWidth int
NetAverage int
NetLink string
- ShowAvgLine bool
- ShowCores bool
+ ShowAvgLine bool
+ ShowIOAvgLine bool
+ ShowCores bool
ShowMem bool
ShowNet bool
SSHOpts string
@@ -105,7 +106,7 @@ func (c *Config) parseReader(f *os.File) error {
"title": true, "barwidth": true, "cpuaverage": true, "extended": true,
"hasagent": true, "height": true, "maxwidth": true, "netaverage": true,
"netlink": true, "showcores": true, "showmem": true,
- "showavgline": true, "shownet": true, "sshopts": true, "cluster": true,
+ "showavgline": true, "showioavgline": true, "shownet": true, "sshopts": true, "cluster": true,
}
scanner := bufio.NewScanner(f)
for scanner.Scan() {
@@ -162,6 +163,8 @@ func (c *Config) set(key, val string) {
c.NetLink = val
case "showavgline":
c.ShowAvgLine = parseBool(val)
+ case "showioavgline":
+ c.ShowIOAvgLine = parseBool(val)
case "showcores":
c.ShowCores = parseBool(val)
case "showmem":
@@ -200,6 +203,7 @@ func (c *Config) writeTo(f *os.File) error {
writeInt("netaverage", c.NetAverage)
writeStr("netlink", c.NetLink)
writeBool("showavgline", c.ShowAvgLine)
+ writeBool("showioavgline", c.ShowIOAvgLine)
writeBool("showcores", c.ShowCores)
writeBool("showmem", c.ShowMem)
writeBool("shownet", c.ShowNet)