diff options
author | Sean E. Russell <ser@ser1.net> | 2020-02-28 10:03:41 -0600 |
---|---|---|
committer | Sean E. Russell <ser@ser1.net> | 2020-02-28 10:06:05 -0600 |
commit | 231b0d03fed93ccc4b5f953f503763966341ec48 (patch) | |
tree | 9bb07a88dd0ac7e73fa82935d0909ef4dd0810a8 /layout | |
parent | 7a89225d729d4c54c5bc95b21979f48f9cd046b1 (diff) |
Extensions.v3.4.x
Diffstat (limited to 'layout')
-rw-r--r-- | layout/layout.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/layout/layout.go b/layout/layout.go index 12bc5d2..bdddaf6 100644 --- a/layout/layout.go +++ b/layout/layout.go @@ -168,8 +168,15 @@ func makeWidget(c gotop.Config, widRule widgetRule) interface{} { w = dw case "mem": m := widgets.NewMemWidget(c.UpdateInterval, c.GraphHorizontalScale) - m.LineColors["Main"] = ui.Color(c.Colorscheme.MainMem) - m.LineColors["Swap"] = ui.Color(c.Colorscheme.SwapMem) + var i int + for key, _ := range m.Data { + if i >= len(c.Colorscheme.MemLines) { + i = 0 + } + color := c.Colorscheme.MemLines[i] + m.LineColors[key] = ui.Color(color) + i++ + } w = m case "temp": t := widgets.NewTempWidget(c.TempScale) |