Fixes #174: different colors for download/upload

This commit is contained in:
Quan Tong 2022-03-26 15:09:34 +07:00
parent e0165a2283
commit 3f903c796c
12 changed files with 15 additions and 14 deletions

View File

@ -20,7 +20,7 @@ The keys are:
BattLines -- array of ints for the colors of lines BattLines -- array of ints for the colors of lines
MemLines -- array of ints for the colors of lines MemLines -- array of ints for the colors of lines
ProcCursor -- int, color of the cursor in the process widget ProcCursor -- int, color of the cursor in the process widget
Sparkline -- int, color of the graph bars Sparklines -- array of ints for the colors of network usage
DiskBar -- int, color of the disk bars DiskBar -- int, color of the disk bars
TempLow -- int, color used for low temperatures TempLow -- int, color used for low temperatures
TempHigh -- int, color used for high temperatures TempHigh -- int, color used for high temperatures

View File

@ -16,7 +16,7 @@ func init() {
ProcCursor: 4, ProcCursor: 4,
Sparkline: 4, Sparklines: [2]int{4, 5},
DiskBar: 7, DiskBar: 7,

View File

@ -15,7 +15,7 @@
"ProcCursor": 4, "ProcCursor": 4,
"Sparkline": 4, "Sparklines": [4, 5],
"DiskBar": 7, "DiskBar": 7,

View File

@ -16,7 +16,7 @@ func init() {
ProcCursor: 33, ProcCursor: 33,
Sparkline: 4, Sparklines: [2]int{4, 5},
DiskBar: 252, DiskBar: 252,

View File

@ -16,7 +16,7 @@ func init() {
ProcCursor: 197, ProcCursor: 197,
Sparkline: 81, Sparklines: [2]int{81, 186},
DiskBar: 102, DiskBar: 102,

View File

@ -29,7 +29,7 @@ func init() {
ProcCursor: 31, // blue (nord9) ProcCursor: 31, // blue (nord9)
Sparkline: 31, Sparklines: [2]int{31, 96},
DiskBar: 254, DiskBar: 254,

View File

@ -19,7 +19,7 @@ func init() {
ProcCursor: 136, ProcCursor: 136,
Sparkline: 33, Sparklines: [2]int{33, 136},
DiskBar: 243, DiskBar: 243,

View File

@ -18,7 +18,7 @@ func init() {
ProcCursor: 4, ProcCursor: 4,
Sparkline: 4, Sparklines: [2]int{4, 5},
DiskBar: 12, // base0 DiskBar: 12, // base0

View File

@ -18,7 +18,7 @@ func init() {
ProcCursor: 4, ProcCursor: 4,
Sparkline: 4, Sparklines: [2]int{4, 5},
DiskBar: 11, // base00 DiskBar: 11, // base00

View File

@ -52,8 +52,8 @@ type Colorscheme struct {
// ProcCursor is used as the color for the color bar in the process widget // ProcCursor is used as the color for the color bar in the process widget
ProcCursor int ProcCursor int
// SparkLine determines the color of the data line in spark graphs // SparkLines define the colors used for the Network usage graphs
Sparkline int Sparklines [2]int
// DiskBar is the color of the disk gauge bars (currently unused, // DiskBar is the color of the disk gauge bars (currently unused,
// as there's no disk gauge widget) // as there's no disk gauge widget)

View File

@ -16,7 +16,7 @@ func init() {
ProcCursor: 159, ProcCursor: 159,
Sparkline: 183, Sparklines: [2]int{183, 146},
DiskBar: 158, DiskBar: 158,

View File

@ -6,6 +6,7 @@ import (
"strings" "strings"
"github.com/xxxserxxx/lingo/v2" "github.com/xxxserxxx/lingo/v2"
"github.com/xxxserxxx/gotop/v4" "github.com/xxxserxxx/gotop/v4"
"github.com/xxxserxxx/gotop/v4/widgets" "github.com/xxxserxxx/gotop/v4/widgets"
@ -186,9 +187,9 @@ func makeWidget(c gotop.Config, widRule widgetRule) interface{} {
w = t w = t
case "net": case "net":
n := widgets.NewNetWidget(c.NetInterface) n := widgets.NewNetWidget(c.NetInterface)
n.Lines[0].LineColor = ui.Color(c.Colorscheme.Sparkline) n.Lines[0].LineColor = ui.Color(c.Colorscheme.Sparklines[0])
n.Lines[0].TitleColor = ui.Color(c.Colorscheme.BorderLabel) n.Lines[0].TitleColor = ui.Color(c.Colorscheme.BorderLabel)
n.Lines[1].LineColor = ui.Color(c.Colorscheme.Sparkline) n.Lines[1].LineColor = ui.Color(c.Colorscheme.Sparklines[1])
n.Lines[1].TitleColor = ui.Color(c.Colorscheme.BorderLabel) n.Lines[1].TitleColor = ui.Color(c.Colorscheme.BorderLabel)
n.Mbps = c.Mbps n.Mbps = c.Mbps
w = n w = n