Skip to content
This repository has been archived by the owner on Aug 29, 2020. It is now read-only.

Commit

Permalink
Closes #11
Browse files Browse the repository at this point in the history
  • Loading branch information
cjbassi committed Apr 9, 2018
1 parent ca4febf commit 6b469e9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ func widgetColors() {
LineColor := make(map[string]ui.Color)
if cpu.Count <= 8 {
for i := 0; i < len(cpu.Data); i++ {
LineColor[fmt.Sprintf("CPU%d", i+1)] = ui.Color(colorscheme.CPULines[i])
LineColor[fmt.Sprintf("CPU%d", i)] = ui.Color(colorscheme.CPULines[i])
}
} else {
LineColor["Average"] = ui.Color(colorscheme.CPULines[0])
Expand Down
4 changes: 2 additions & 2 deletions widgets/cpu.go
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ func NewCPU(interval time.Duration, zoom int) *CPU {
self.Zoom = zoom
if self.Count <= 8 {
for i := 0; i < self.Count; i++ {
key := "CPU" + strconv.Itoa(i+1)
key := "CPU" + strconv.Itoa(i)
self.Data[key] = []float64{0}
}
} else {
Expand All @@ -48,7 +48,7 @@ func (self *CPU) update() {
if self.Count <= 8 {
percent, _ := psCPU.Percent(self.interval, true)
for i := 0; i < self.Count; i++ {
key := "CPU" + strconv.Itoa(i+1)
key := "CPU" + strconv.Itoa(i)
self.Data[key] = append(self.Data[key], percent[i])
}
} else {
Expand Down

0 comments on commit 6b469e9

Please sign in to comment.